필터 지우기
필터 지우기

plot

조회 수: 2 (최근 30일)
Baba
Baba 2011년 11월 17일
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.

답변 (1개)

Walter Roberson
Walter Roberson 2011년 11월 17일
FirstTime = Time(1) - 9/10 * mean(diff(Time));
NewTimes = linspace(FirstTime, Time(end), length(Data));
plot(NewTimes, Data);
The above code is for the case where the Time vector was first sampled at the 10th data point, and assumes that the time vectors were sampled at intervals that average out equally. The first line is to back-project to the starting time.
The code would be pretty similar in spirit if instead the first Time corresponds to the starting time, and it was the end time that was unknown.
  댓글 수: 2
Baba
Baba 2011년 11월 18일
is there a way to create n spaces between matrix elements and then fill those spaces in?
Walter Roberson
Walter Roberson 2011년 11월 18일
No, there isn't. Matrix elements _always_ have a value.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by