MATLAB Error -- "Not enough input arguments"

3 views (last 30 days)
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?

Accepted Answer

Star Strider
Star Strider on 22 Nov 2014
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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!