Creating a function?
古いコメントを表示
I have spent the last hour researching and am still having problems trying to create a simple function. It says things like "Undefined function or variable 't' or "not enough input arguments'. All I want to do is create a function: Height(t) that can find the values when the height is 0 based on it's equation, so this is what I did:
function h = Height(t)
h = 2.13*t.^2-0.0013*t.^4+0.000034*t.^4.751;
end
Why does this show an error? And what command can I use to find when h = 0?
Thanks
1 件のコメント
Make sure you run it from command line or another function/script passing in an argument, don't just click the green 'Run' button which obviously cannot possibly supply the 't' input the function expects.
Also, look at
doc fzero
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!