Importing two different files with different sampling rate

i need to import,plot & compare two different experimental data,seperated by comma(in .txt format). These two files eventhough recording time(start to end) is same,sampling rate is different.One records 4 samples per sec.Other at 8 samples per sec. My query now is if i import these file..because of difference in sampling rate..data matrix size will be different.So,when i plot with time matlab generates error stating'Both matrix are of different sizes' Can some body help me how to come across this problem??
I need to plot both in same plot for comparision..

 채택된 답변

Jan
Jan 2012년 5월 17일
Please post the code, which causes the problem. Perhaps it can be solved easily:
t1 = 1:100;
x1 = rand(size(t1));
t2 = 3:4:97;
x2 = rand(size(t2));
plot(t1, x1, 'b');
hold on;
plot(t2, x2, 'r');

추가 답변 (1개)

Wayne King
Wayne King 2012년 5월 17일

0 개 추천

There are multiple things you can do. A couple of these are:
1.) You can resample the data using resample() That would enable you to visualize them on the same time axis.
2.) You can plot them in different subplots.

카테고리

도움말 센터File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by