error when running a function

guys please i need help.. am getting error when i run this.
function Y= microstrip(L,W)
fr= 6.2; h=2; er=2.25;
ee= ((er+1)/2)+((er-1)/(2*sqrt(1+10*(h/W))));
deltw= (0.412*h)*(((ee+0.3)*((W/h)+0.264))/((ee+0.258)*((W/h)+0.813)));
Y=300000000/(2*((L+deltw)*(sqrt(ee))));
end
Error
Not enough input arguments.
Error in microstrip (line 3)
ee= ((er+1)/2)+((er-1)/(2*sqrt(1+10*(h/W))));

6 件のコメント

James Tursa
James Tursa 2020 年 4 月 5 日
What inputs are you using? Please copy & paste entire error message for us.
mohamed ali
mohamed ali 2020 年 4 月 5 日
Thanx james for your fast response. :)
i got Not enough input arguments.
Error in microstrip (line 3)
ee= ((er+1)/2)+((er-1)/(2*sqrt(1+10*(h/W))));
I'll use this function on my optimization tool box.
James Tursa
James Tursa 2020 年 4 月 5 日
Well, are you calling the function with two inputs? How are you calling it?
mohamed ali
mohamed ali 2020 年 4 月 5 日
actually i didnt reach to the part of calling, because when i try to run this script (function) it giving me error.
James Tursa
James Tursa 2020 年 4 月 5 日
You did call it because the funciton is returning an error. Maybe you didn't think you did ... but you did. DId you just push the green triangle "go" button in the editor? Because that is equivalent to calling the function with no inputs.
mohamed ali
mohamed ali 2020 年 4 月 5 日
yes , i did :)
i shouldn't ?

サインインしてコメントする。

回答 (1 件)

James Tursa
James Tursa 2020 年 4 月 5 日
編集済み: James Tursa 2020 年 4 月 6 日

1 投票

Do not push the green triangle "go" button in the editor since that calls the function without any input arguments. Instead, call it from somewhere else with inputs. E.g., at the command line:
L = rand; % whatever
W = rand; % whatever
Y = microstrip(L,W); % called with inputs

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

質問済み:

2020 年 4 月 5 日

編集済み:

2020 年 4 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by