Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Can someone help me with the code to plot this

1 Ansicht (letzte 30 Tage)
Ziv Melamed
Ziv Melamed am 6 Jul. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentare
John D'Errico
John D'Errico am 6 Jul. 2017
Show what you tried. Otherwise, you are just asking us to do your homework for you.
Ziv Melamed
Ziv Melamed am 6 Jul. 2017
Bearbeitet: Walter Roberson am 6 Jul. 2017
>> x=[0,1];
>> y1=sqrt((sin(x).^2)+exp(-(x/2)))
y1 =
1.0000 1.1466
>> plot(x,y1)

Antworten (1)

Walter Roberson
Walter Roberson am 6 Jul. 2017
x = linspace(0,1);
  4 Kommentare
Les Beckham
Les Beckham am 7 Jul. 2017
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 am 7 Jul. 2017
Good catch, Les.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by