Azzera filtri
Azzera filtri

Plotting a simple shape in Matlab

5 visualizzazioni (ultimi 30 giorni)
Peter Laslo
Peter Laslo il 27 Set 2015
Risposto: Martin Schätz il 17 Ott 2015
Hello,
I want to plot part of x >=y and 0=<z<pi in Mathlab. I will eventually have data and curves inside these bounds but I need to plot this for starters. Any ideas?
Thanks!

Risposte (1)

Martin Schätz
Martin Schätz il 17 Ott 2015
Hi, if you don't know the bounds for x and y you don't have enough info to plot some shape, easiest would be to prepare setings of your axis. You can use similar command:
axis([xmin xmax ymin ymax zmin zmax cmin cmax]) % sets the x-, y-, and z-axis limits and the color scaling limits (see caxis help for more info) of the current axes.
so if we use ezplot3 for now instead plot3
figure
ezplot3('sin(t)','cos(t)','t',[0,6*pi])
with what you want, it might be like this:
%zmin=0; %min of z
%zmax=pi; %max of z
%xmin=min(x); %not specified
%xmax=max(x); %x >=y
%ymin=min(y); %not specified
%ymax=max(x); %x >=y
%axis([xmin xmax ymin ymax zmin zmax])
but we need some real values now, so lets say x=0->1 y=0->2 z=0->3
axis([0 1 0 2 0 3])
and we will get:

Categorie

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

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by