Rescale an axis in other steps without creating vector
4 visualizzazioni (ultimi 30 giorni)
I have the following problem: I have for example 1000 measurement points but in 0.02 second steps. In the plot I want to have not a scale from 0 to 1000 but from 0 to 20 (=1000*0.02). As I don't know the length of my data points, I cannot create a vector in 0.02 steps for the x-axis because then Matlab returns that the vectors must be the same lengths.
Is there a possibility, just to divide the x-axis by 50?
Modificato: sixwwwwww il 3 Dic 2013
You can control your x-axis by plotting your data against your time as follows:
y = rand(1, 1000); % your data
x = linspace(0, 0.02, numel(y)); % your time series
plot(x, y) % your plot of data against time series
or you can use 'xlim' for this purpose. see
for more information