Issues with entering into MATLAB

2 ビュー (過去 30 日間)
Nicholas Deosaran
Nicholas Deosaran 2020 年 9 月 17 日
回答済み: Star Strider 2020 年 9 月 17 日
hello all I am trying to enter this into MATLAB but cant seem to get it right
x = 0:0.1:10
y= (2*x^1.01)+ sin(3*pi/2 *x)-10*cos(x)-3
plot(x,y)
[x,y]=ginput(n) % find the first 2 zeros
Please let me know if I am right or i did it wrong.
Thank you

採用された回答

Star Strider
Star Strider 2020 年 9 月 17 日
This sems to be homework.
Vectorise the expoinentiation:
y= (2*x.^1.01)+ sin(3*pi/2 *x)-10*cos(x)-3;
↑ ← HERE
Then to find the approximate indices of the zero-crossings:
zxi = find(diff(sign(y)));
Then use those with interp1 to find much more precise estimates of the zero-crossing x-values.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by