Hi, my code has the following error:
"Unable to perform assignment because the left and right sides have a different number of elements.
Error in sym/privsubsasgn (line 1126)
L_tilde2 = builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);
Error in sym/subsasgn (line 963)
C = privsubsasgn(L,R,inds{:});
Error in main (line 49)
S(j) = solve(eqn, DegU, 'Real', true);"
My code is as follows:
x = ones(1,26); alpha = (4*10^-3)/(4.8*10^-2); [phos_rate] = (0.01:0.001:0.035); for i = 1:26 inv_phos_rate(i) = x(i)/phos_rate(i); inv_phos_rate; end for i = 1:length(phos_rate) c1(i) = sqrt(7*(0.1/0.025)*(inv_phos_rate(i))^2); c2(i) = (((4*10^-4)*((10^-2)/(4.8*(10^-2)*4*(10^-2))))*(1+phos_rate(i)))^-1; c1; c2; end for j = 1:26 syms DegU eqn = ((alpha*((c1(j))^2) + DegU^2)/((c1(j))^2 + DegU^2)) - (DegU)/(c2(j)) ==0; S(j) = solve(eqn, DegU, 'Real', true); S; end plot(phos_rate, S)
Could anybody explain what is going wrong?
Best Answer