MATLAB Error -- "Not enough input arguments"

조회 수: 10 (최근 30일)
Jooseppi Luna
Jooseppi Luna 2014년 11월 22일
댓글: Star Strider 2014년 11월 22일
Hello All,
For my first post I have a question about an error that I am getting while trying to run a function that calculates some parametrics for a wind turbine. Without further ado, here is the code:
function [BladeAngle, BladeChord, R] = designBlade_TuesPM(NumBlades, Radius, TSR, VWind )
%Intermediate Variables
Vtip = TSR*VWind;
R = 0:0.0222222222:0.2;
Vr = Vtip*(R/Radius);
%Outputs
BladeAngle = atan(3*Vr/(2*VWind));
BladeChord = (8.*pi.*R.*VWind.*cos(BladeAngle))./(3.*Vr.*0.8.*NumBlades);
Here is the error I get while trying to run it:
>> NumBlades = 3;
>> Radius = .2;
>> TSR = 5;
>> VWind = 1;
>> designBlade_TuesPM
Error using designBlade_TuesPM (line 4)
Not enough input arguments.
It seems to me like I should have enough inputs for line four. What's going wrong here?

채택된 답변

Star Strider
Star Strider 2014년 11월 22일
You need to use it in your script (preferably not always from the Command Window) as:
[BladeAngle, BladeChord, R] = designBlade_TuesPM(NumBlades, Radius, TSR, VWind )
so that you give it values for: NumBlades, Radius, TSR, and VWind, and in return it provides you with values for: BladeAngle, BladeChord, and R.
Also, consider using:
BladeAngle = atan2(3*Vr, (2*VWind));
if you get dodgy values for BladeAngle.
  댓글 수: 2
Jooseppi Luna
Jooseppi Luna 2014년 11월 22일
Thanks! That helps a lot.
Star Strider
Star Strider 2014년 11월 22일
My pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by