How can I subtract 2 2D graphs made by vectors of different length?
5 ビュー (過去 30 日間)
古いコメントを表示
I have 2 sets of data from the same experiment recorded with different methods. The results are 2 graphs describing the same but with some differences. To find those differences I want to subtract the graphs so that I can have a visual representation of where the differences are located.
The problem I have is that the first method has a "X resolution" of 10 data points per second, but the second method's resolution is not constant, sometimes its 7, sometimes its 15. Because of this I can’t just subtract the arrays, since they are not the same length.
Is there a way to do this?
0 件のコメント
採用された回答
Image Analyst
2018 年 6 月 6 日
Yes, just use interp1() to interpolate them to a common time sequence. If you can't figure it out, attach your two vectors in a .mat file, say what you want the new sampling spacing to be, and someone will do it for you.
その他の回答 (1 件)
Alfonso
2018 年 6 月 6 日
If you want to quantify the "difference" between 2 datasets of different length, say dataset A with length 100 and dataset B with length 150, you can interpolate the x and y coordinates of dataset A using the "interp1" function to 150 points (length B), then you could for example, calculate the RMSE between the 2 datasets to quantify the differences. (This is one of the ways you could do it)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!