Smallest of 3 arrays
2 次查看(过去 30 天)
显示 更早的评论
I have 3 array:
Acc_X: 1x1161 double,
Acc_Y: 1x1155 double,
Acc_Z: 1x1158 double,
I would like to choose the smallest of these 3 (like an if loop) and based on that remove the values from the other arrays. So in this case it will be 1x1155 for all 3.
For example remove the last 6 values from Acc_X
Anybody have a godd suggestion? THanks for the help :)))
0 个评论
采纳的回答
Walter Roberson
2020-10-14
L = min([length(Acc_X), length(Acc_Y), length(Acc_Z)]);
Acc_X = Acc_X(1:L);
Acc_Y = Acc_Y(1:L);
Acc_Z = Acc_Z(1:L);
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!