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?
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!