MATLAB: How to Plot a graph with restriction

limitationplotvariable

Hi,
I am sorry I am new to MATLAB and dont know how to exactly formulate my quetsion.
I want to plot a graph between two variables but I want to restrict the plot area with a third varible. For example:
x = (0.5*pi:0.1:6*pi) y = sin(x)
Plot (x,y)
but now i want to restrict my plot with the following variable:
z = (pi:0.1;2*pi)
Note: The divisions are same for 'x' and 'z'.
Thanks, Mustahsan

Best Answer

Mustahsan, what do you mean by restrict? Setting the plotting limits? Something like:
xlim([pi, 2*pi])