MATLAB: Question about plotting, getting subvectors

plot

Hi,
I'm new to Matlab central, but not new to Matlab itself. I'm running a simulation which has an end results of two columns of values. I ususally plot these values using plot(1stcolumn,2ndcolumn). My question is: how do I plot only a small amount of these values? Like say 1stcolumn(40) to 1stcolumn(60)? I've tried exactly this in Matlab, but I am only getting an empty graph sheet (no errors are showing either):
plot(1stcolumn(40),2ndcolumn(40),1stcolumn(40),...
2ndcolumn(40)1stcolumn(40),2ndcolumn(40),...
1stcolumn(40),2ndcolumn(40))
What am I doing wrong?
RebSam

Best Answer

vector(1:40) %get all values from index 1 to 40
Your mistake is that you just plot the value at index 40 with your code vector(40)
Related Question