4 visualizzazioni (ultimi 30 giorni)
Leora il 26 Ago 2014
Commentato: Leora il 26 Ago 2014
Use a linspace command or colon operator to create a vector with 91 elements and define the function y=[e^(t/10)sin(t)]/(t^2 +1)
Plot the function y in black and include a title with the expression for y
Make the same plot again but rather than displaying the graph as a curve, show the unconnected data points. To display them in small circles use plot(t,y,'o') and combine it by using plot(t,y,'o-')
I tried to do it and this is my code but for some odd reason it is just a straight line parallel to the x axis (not even a line just small black points, I even tried suppressing the plot(t,y,'o') amd plot(t,y,'o-') but it just won't give me a curve just data points in a straight 'line':
t=linspace(1,10,91); y=(exp(t/10).*sin(t))/(t.^2+1); figure plot(t,y,'k-') title('plot by Leora') plot(t,y,'o') plot(t,y,'-o')
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Roger Stafford il 26 Ago 2014
You need to put a dot on the division symbol:
y=(exp(t/10).*sin(t))./(t.^2+1);
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Leora il 26 Ago 2014
Oh wow I feel stupid, thank you!

Accedi per commentare.

### Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by