Error using type too many output arguments

4 次查看(过去 30 天)
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

回答(1 个)

Sam Chak
Sam Chak 2025-3-4
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

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by