Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Can someone help me with the code to plot this

1 回表示 (過去 30 日間)
Ziv Melamed
Ziv Melamed 2017 年 7 月 6 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Can someone tell me how to plot this function on matlab. Every time I input the function and try plotting, the graph does not look right.
  2 件のコメント
John D'Errico
John D'Errico 2017 年 7 月 6 日
Show what you tried. Otherwise, you are just asking us to do your homework for you.
Ziv Melamed
Ziv Melamed 2017 年 7 月 6 日
編集済み: Walter Roberson 2017 年 7 月 6 日
>> x=[0,1];
>> y1=sqrt((sin(x).^2)+exp(-(x/2)))
y1 =
1.0000 1.1466
>> plot(x,y1)

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 7 月 6 日
x = linspace(0,1);
  4 件のコメント
Les Beckham
Les Beckham 2017 年 7 月 7 日
You should check your parentheses also. As written, you are taking the square root of the entire expression instead of just the sin^2(x) portion.
Walter Roberson
Walter Roberson 2017 年 7 月 7 日
Good catch, Les.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by