Graph plotting HELP NEEDED
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Saad Rana
am 19 Mär. 2020
Beantwortet: Steven Lord
am 19 Mär. 2020
How can I plot this graph in matlab?
I have trouble plotting this one
4 Kommentare
Sriram Tadavarty
am 19 Mär. 2020
Saad, i suggest you to go through MATLAB onramp course here https://www.mathworks.com/learn/tutorials/matlab-onramp.html
Akzeptierte Antwort
Star Strider
am 19 Mär. 2020
Try this:
x = linspace(-1, 3);
y = 2*((x >= 0) & (x < 1)) + 1*((x >= 1) & (x < 2));
figure
stairs(x, y)
grid
axis([-1 3 -1 3])
0 Kommentare
Weitere Antworten (1)
Steven Lord
am 19 Mär. 2020
If you're trying to create a plot that has a particular appearance but you're not sure which function can create such a plot, open the Plots tab on the Toolstrip. This includes a gallery where you can look at small thumbnails and see which function was used to create each. Find a plot that looks similar to what you want and look for help or doc on the function whose name appears below the thumbnail.
If you select the data you want to plot in the Workspace window, you can even filter that list to those functions that are appropriate for the selected data.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Animation finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!