How to compare two vectors that don't have equal length?
3 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I have two vectors, x1 with a length of 755, and x2 a the length of 756.
I want to minus these two vectors to find out how much their cells are different.
do you have any suggestions to make these comparison?
for example: x1=[21, 108, 195, 281,..... ] (length=755) and x2=[21, 109, 197, 280, ......] (length=756)
I appreciate any suggestions...
0 件のコメント
採用された回答
Voss
2021 年 12 月 9 日
Well, you can compare the first 755 elements:
dx = x1 - x2(1:end-1);
or you could compare the last 755 elements:
dx = x1 - x2(2:end);
Based on the first few elements that you mentioned, probably the first option is what you want. No matter what, you're going to have one element of x2 that's left out.
6 件のコメント
Voss
2021 年 12 月 14 日
Assuming those data are regularly-sampled, it shouldn't matter whether you use index or time.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!