plot

2 Ansichten (letzte 30 Tage)
Baba
Baba am 17 Nov. 2011
i have a column of data that has 100 points I also have a time column which only has 10 points basically data was sampled at 10Hz, but my time vector contains time value for every 10th sample.
How would I plot this? I run into a problem since the vectors are of different size.
  2 Kommentare
Baba
Baba am 17 Nov. 2011
i'm thinking i can add aditional time points in my time matrix
to make it's length equal to data matrix.
I have:
time=[1,2,3,4,5,6,7,8,9,10]
I need:
time=[1,1.1,1.2,1.3,1.4........10]
not sure how to do that either.
Walter Roberson
Walter Roberson am 17 Nov. 2011
Duplicate is at http://www.mathworks.com/matlabcentral/answers/21564-plot

Melden Sie sich an, um zu kommentieren.

Antworten (1)

bym
bym am 17 Nov. 2011
use interp1 to resample your time vector to match the data vector
  12 Kommentare
Baba
Baba am 18 Nov. 2011
seems that there should be a way to create n empty spaces between each matrix element and then fill them in.
Walter Roberson
Walter Roberson am 18 Nov. 2011
There is no method of creating empty spaces in a vector.
Note that if interp1() is used, use the 'linear','extrap' options.
You will also have to calculate the data point endpoints. But if you have already gone through the trouble of figuring out the endpoints, then you might as well use linspace()
Use the code from your other thread, but for the Time values, instead of passing in your 200159 and so on, pass in
Time = datenum(str2num(YourTimes.'));
and use the datetick suggestion,
datetick('x','HH:MM:SS.FFF')

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Preprocessing 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!

Translated by