Character vectors and strings in the first argument can only specify a variable or number.
Show older comments
Character vectors and strings in the first argument can only specify a variable or number.
To evaluate character vectors and strings representing symbolic expressions, use str2sym
Tmr=3728;
Amr=932;
rho=0.002378;
Ohm=36;
Rmr=17.22;
smr=0.034;
Cla_d=0.11;
Cla_r=Cla_d/0.01745;
a=1131.55;
bmr=2;
CTreq=Tmr/(rho*Amr*(Ohm*Rmr)^2);
tetatwdeg=-12;
tetatwrad=tetatwdeg*0.01745;
for i=1:1:12
if i==1
teta0rad=(6*CTreq/(smr*Cla_r))-(0.75*tetatwrad+(0.75*sqrt(2)*sqrt(CTreq)));
else
teta0rad=(6*CTreq/(smr*Cla_r))-(0.75*tetatwrad+(1.5*sqrt(CTreq/2)));
end
myEqn = sym('teta0rad =(6*CT/(smr*Cla_r))-(0.75*tetatwrad+(1.5*sqrt(CT/2)))');
newEqn = subs(myEqn,{'teta0rad','smr','Cla_r','tetatwrad'}, [teta0rad,smr,Cla_r,tetatwrad]);
CTi=solve(newEqn);
teta0rad=teta0rad+(6*(CTreq-CTi)/(smr*Cla_r))+(0.75*sqrt(2)*(sqrt(CTreq)-sqrt(CTi)));
end
Why do I get that error?
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!