Dimensions do not match.

28 views (last 30 days)
ramya k
ramya k on 19 Apr 2021
Answered: Walter Roberson on 19 Apr 2021
please help me in corecting this code. I have to give A as array of 10 values but getting error like dimensions are not matching .. please help me how to match the dimensions.
theta=-1:0.01:1;
u=sin(theta);
for theta= -1:0.01:1
syms x
A=[0.96058 0.82596 0.576 0.29171 0.12276 0.12276 0.29171 0.576 0.82596 0.96058];
fun=A*exp(1j*pi*30*u*x);
E=int(fun,x,-1,1);
end
M=max(E);
Y=abs(E);
G=Y./M;
Edb=20*log10(G);
plot(u,Edb);
error:
Error using symengine
Dimensions do not match.
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in * (line 315)
X = privBinaryOp(A, B, 'symobj::mtimes');

Answers (1)

Walter Roberson
Walter Roberson on 19 Apr 2021
thetavals = -1:0.01:1;
A = [0.96058 0.82596 0.576 0.29171 0.12276 0.12276 0.29171 0.576 0.82596 0.96058];
u = sin(thetavals);
syms x U real
fun = A*exp(1j*pi*30*U*x)
fun = 
Eint = int(fun,x,-1,1)
Eint = 
E0 = limit(Eint, U, 0);
E0idx = find(u == 0);
u(E0idx) = nan;
E = subs(Eint, U, u(:));
E(E0idx,:) = E0;
M = max(E, 2);
Y = abs(E);
G = Y./M;
Edb = 20*log10(G);
plot(thetavals, Edb);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!