Info

此问题已关闭。 请重新打开它进行编辑或回答。

Can someone help me with the code to plot this

1 次查看(过去 30 天)
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.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by