Error using type too many output arguments

조회 수: 5 (최근 30일)
ryan
ryan 2025년 3월 4일
답변: Sam Chak 2025년 3월 4일
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