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) ...
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.