can i change the x axis without changing the plot? So i have a array with 10000 numbers in it, i want to plot thoes 10000 numbers in time, like 0-10sec insted of 0-10000.

2 visualizaciones (últimos 30 días)
buf = ones(10000,1)*nan;
i = 1; x = rand(10000,1);
for i <= 10000 buf(i,1) = x i = i+1; end plot(buf)

Respuesta aceptada

Chris McComb
Chris McComb el 14 de Abr. de 2015
You just need to supply a vector of x values. Something like
x = linspace(0, 10, length(buf));
Then, just plot as
plot(x, buf);

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by