Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
Hi Yogeshwari, the error occurs because you're trying to assign a vector (1x2) to a single element of the symbolic array U and V.
U(1) = 0.05 * (1 - tanh(B * (20 * (x - 0.5))));
V(1)=b0*(A-tanh(B*(20*(x-0.5))));
%% results in a 1x2 vector on the right side, which cannot be assigned to a single element on the left
Also double-check your implementation as 'B' is initially defined as a symbolic variable and is later changed to a symbolic vector making the initial declaration redundant.
On the right hand side, all of the symbolic vector B is used, so the right hand side will be a 1 x 2 result. But you are attempting to assign that 1 x 2 result into a single location, U(1)
If you'd eliminated the line of code that overwrites the scalar you'd assigned to B first with the symbolic vector, it would give you an answer. I'll leave it to you to determine if that's the answer you expected.
syms x
syms t
b0=0.05
b0 = 0.0500
a3=0.1
a3 = 0.1000
b3=0.3;
% These assign scalars to A and B
A=(2*b3-1)/(2*a3-1)
A = 0.5000
B=(1/2)*b0*((4*a3*b3-1)/2*a3-1)
B = -0.0261
U=zeros(1,2,'sym');
V=zeros(1,2,'sym');
% Commenting these two lines out (so A and B aren't overwritten) ...
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.