Error using type too many output arguments
4 views (last 30 days)
Show older comments
I'm running into the error " Error using type Too many output arguments" when I run the code I've pasted below. I;m not sure what this error means and can't find similar situations online. This is just a snip of the code, the variables not defined in it are defined by user input during a previous part of the code that functions properly. I've bolded and underlined the line getting the error.
%variable setup
if strcmpi(type,'corner')
delta=1
iteration=0
while delta>(10^-6)
L=0
M2=0
A=((19000*B)/(RD))^.8
%equation conditions
if(d*1000<12.5)
return
end
if(D*1000<50)
return
end
if(D*1000>1000)
return
end
if(.1>B)
return
end
if(.75<B)
return
end
if(.1<B<.56)
if(RD<5000)
return
end
end
if(B>.56)
if(RD<(16000*B^2))
return
end
end
%C value equation
if(D*1000<71.12)
C=.5961+(.0261*B^2)-.216*(B^8)+.000521*(((B*10^6)/(RD))^.7)+((.0188+.0063*A)*B^3.5)*(((10^6)/(RD))^.3)+(.043+.08*exp(-10*L)-.123*exp(-7*L))*(1-.11*A)*((B^4)/(1-B^4))-.031*(M2-.8*(M2^1.1))*(B^1.3)+0.011*(.75-B)*(2.8-(D*1000/25.4))
else
C=.5961+(.0261*B^2)-.216*(B^8)+.000521*(((B*10^6)/(RD))^.7)+((.0188+.0063*A)*B^3.5)*(((10^6)/(RD))^.3)+(.043+.08*exp(-10*L)-.123*exp(-7*L))*(1-.11*A)*((B^4)/(1-B^4))-.031*(M2-.8*(M2^1.1))*(B^1.3)
end
end
end
0 Comments
Answers (1)
Sam Chak
on 4 Mar 2025
Possibly syntax error. The strcmpi() function is used to compare strings. So, you need to place the texts in double quotes.
%variable setup
if strcmpi('type', 'corner')
delta=1
iteration=0
while delta>(10^-6)
L=0
M2=0
A=((19000*B)/(RD))^.8
%equation conditions
if(d*1000<12.5)
return
end
if(D*1000<50)
return
end
if(D*1000>1000)
return
end
if(.1>B)
return
end
if(.75<B)
return
end
if(.1<B<.56)
if(RD<5000)
return
end
end
if(B>.56)
if(RD<(16000*B^2))
return
end
end
%C value equation
if(D*1000<71.12)
C=.5961+(.0261*B^2)-.216*(B^8)+.000521*(((B*10^6)/(RD))^.7)+((.0188+.0063*A)*B^3.5)*(((10^6)/(RD))^.3)+(.043+.08*exp(-10*L)-.123*exp(-7*L))*(1-.11*A)*((B^4)/(1-B^4))-.031*(M2-.8*(M2^1.1))*(B^1.3)+0.011*(.75-B)*(2.8-(D*1000/25.4))
else
C=.5961+(.0261*B^2)-.216*(B^8)+.000521*(((B*10^6)/(RD))^.7)+((.0188+.0063*A)*B^3.5)*(((10^6)/(RD))^.3)+(.043+.08*exp(-10*L)-.123*exp(-7*L))*(1-.11*A)*((B^4)/(1-B^4))-.031*(M2-.8*(M2^1.1))*(B^1.3)
end
end
end
0 Comments
See Also
Categories
Find more on Introduction to Installation and Licensing 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!