how do i plot a graph in xy?
54 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
how do i plot a graph for y = x3? what should i do?
0 Kommentare
Antworten (2)
Chad Greene
am 5 Nov. 2014
If you mean y equals x cubed,
1. define an x array:
x = 1:100;
2. calculate y
y = x.^3;
3. plot
plot(x,y)
0 Kommentare
James Tursa
am 5 Nov. 2014
Do you mean y = x^3? If so, first pick a range for x, then calculate y, then plot it. E.g.,
x = 0:0.1:3; % From 0 to 3 in increments of 0.1
y = x.^3; % Element-wise power uses .^
plot(x,y)
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!