Set axis to plot data against a specific scale

1 次查看(过去 30 天)
I have about 16000 rows of data that are taken like 1 sec apart, but i want to plot them over the number of days that the this occurs. what do i input into matlab to make it stop plotting by number of data points on the x axis and instead replace the xaxis with an arbitrary scale.
For example if I want to plot all 16000 from 0-1 on the x axis, i want each data point to correspond to 1/16000 on the x axis. Since the number of data points changes all the time from file to file how can I make it adjust the scale so that it is always properly done?

采纳的回答

Chad Greene
Chad Greene 2014-10-8
If your 16000 rows of data are described by y, try this:
x = linspace(0,1,length(y));
plot(x,y)
The linspace function evenly spaces from the first argument (0 in the case above) to the second argument (1 in the case above) using the third arument (the length of y) as the number of steps.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by