Hi there,
I would greatly appreciate any help for this simple enough issue:
I have a spectra to plot (2D), with 1201 rows (x), and 74 columns (y). My x is a range of 200nm- 800nm. This is what I would like to display on the x axis proportionally. Although Matlab plot function automatically display my sample number which is 1201 (0- 1201 etc). How could I re-scale my x axis without losing any information and displaying my x from 200nm to 800nm.
Hope this is clear enough explanation...
Again, greatly appreciate any help...
Thank you in advance.
No products are associated with this question.
Simplest is to simply build the x vector and use it to plot() against instead of the default index vector.
If it is indeed linear from 200:800 for 1201 points, then linspace is your friend...
x=linspace(200,800,length(y))'; % Use length(y) for dynamic matching... plot(x,y)
NB the "'" transpose on x to create a column vector to make the shape commensurate w/ the y array since linspace returns a row vector.
0 Comments