Set axis to plot data against a specific scale
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
matlabuser12
am 8 Okt. 2014
Beantwortet: Chad Greene
am 8 Okt. 2014
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 Kommentare
Akzeptierte Antwort
Chad Greene
am 8 Okt. 2014
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!