MATLAB Error -- "Not enough input arguments"

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

更多回答(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