フィルターのクリア

Error "Undefined function or variable"

2 ビュー (過去 30 日間)
Shikhar Sharma
Shikhar Sharma 2019 年 9 月 9 日
コメント済み: Shikhar Sharma 2019 年 9 月 9 日
I defined a function;
function [maBar, wBar, alphaBar] = hcEqPt(vBar, c1, c2, c3, c4)
wBar = vBar/0.129;
maBar = (36.6 + 0.106*wBar + c4*(wBar^2))/c3;
alphaBar = (acos(1-(c2*wBar*maBar/c1)) + 0.0252)/ 1.14;
end
[maBar_1, wBar_1, alphaBar_1] = hcEqPt(22, 0.6, 0.095, 47500, 0.0026);
disp("At v=22, ma = %d, w = %d, alpha = %d", maBar_1, wBar_1, alphaBar_1);
When I try to use this function to obtain a values of vBar further in the script it shows an error "Undefined function or variable".
Kindly help.

回答 (1 件)

madhan ravi
madhan ravi 2019 年 9 月 9 日
[maBar_1, wBar_1, alphaBar_1] = hcEqPt(22, 0.6, 0.095, 47500, 0.0026);
fprintf('At v=22, ma = %d, w = %d, alpha = %d', maBar_1, wBar_1, alphaBar_1);
function [maBar, wBar, alphaBar] = hcEqPt(vBar, c1, c2, c3, c4)
wBar = vBar/0.129;
maBar = (36.6 + 0.106*wBar + c4*(wBar^2))/c3;
alphaBar = (acos(1-(c2*wBar*maBar/c1)) + 0.0252)/ 1.14;
end
  22 件のコメント
madhan ravi
madhan ravi 2019 年 9 月 9 日
編集済み: madhan ravi 2019 年 9 月 9 日
Looks like you didn't give any attention to the suggestion , well done :). See the attached file.
Please again don't miss the valuable comment given by sir Walter
Shikhar Sharma
Shikhar Sharma 2019 年 9 月 9 日
Thank you very much for your time. I am quite new to this and trying to cope up with it.
Thank you for being patient. :)

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

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by