How to I limit the plot range to [0, 4]?
Show older comments
Answers (1)
Star Strider
on 29 Nov 2018
0 votes
5 Comments
Szymon Krasnicki
on 29 Nov 2018
Star Strider
on 29 Nov 2018
You posted no code, so I have no idea what the problem may be with linspace.
If you want ‘x’ for example to go from 0 to 4 with 150 points, the linspace call would be:
x = linspace(0, 4, 150);
Szymon Krasnicki
on 29 Nov 2018
Szymon Krasnicki
on 29 Nov 2018
Star Strider
on 29 Nov 2018
The linspace function will create vectors. It will not do anything with respect to the axis limits.
I would do something like this (using the axis function, as I previously described):
[x,y,z] = cylinder(3);
z(2, :) = 4;
surf(x,y,z);
axis([0 4 0 4 0 4])
Categories
Find more on Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!