Azzera filtri
Azzera filtri

Set axis to plot data against a specific scale

2 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Chad Greene
Chad Greene il 8 Ott 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.

Più risposte (0)

Categorie

Scopri di più su Visual Exploration in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by