please remove the if statement error

1 view (last 30 days)
saqib
saqib on 4 Apr 2014
Answered: Walter Roberson on 4 Apr 2014
clc
syms h1 h2 h3 f1 f2 f3 fc1 fc2 fc3 L Lmax Lmin Lmid p1 p2 p3
syms pload x xx xxx pi z up
h1 = 510+7.2*p1+0.00142*(p1^2)
h2 = 310+7.85*p2+0.00194*(p2^2)
h3 = 78+7.97*p3+0.00482*(p3^2)
fc1 = 0.9
fc2 = 1
fc3 = 1
f1 = h1*fc1
f2 = h2*fc2
f3 = h3*fc3
pload=850
L= 8
x=diff(f1,p1)
x=x-L
x=solve(x)
xx= diff(f2,p2)
xx=xx-L
xx=solve(xx)
xxx=diff(f3,p3)
xxx=xxx-L
xxx=solve(xxx)
pi=x+xx+xxx
e=pload-pi
if(e<0.001)
goto (53)
return
end
if e>0
L=1.1*L
goto(20)
return
else
L=0.9*L
goto(20)
return
end
Label 2
L

Answers (1)

Walter Roberson
Walter Roberson on 4 Apr 2014
What is goto() ? It is not a Mathworks provided function. MATLAB does not offer a GO TO construt.

Community Treasure Hunt

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

Start Hunting!