![ml_test.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/239292/ml_test.jpeg)
plotting offset between data
4 ビュー (過去 30 日間)
古いコメントを表示
hey guys i have a file.mat that i want to plot the offset between the data, which is t1 though t7. i want to create a loop that goes though each element to calculate the offset. im not sure how to create the loop. any help is appreciated. i want Plot all possible offsets (between the 7 embedded node clocks) as a function of the reference time.
thank you!
0 件のコメント
採用された回答
SaiDileep Kola
2019 年 9 月 23 日
Hi Boutros,
If you mean to plot the deviation of the data between all possible pair this is how you can realize the solution for your task
d_ar= [t1;t2;t3;t4;t5;t6;t7];
close all;
for i=1:6
for j=i+1:7
plot(tref,d_ar(i,:)-d_ar(j,:),'DisplayName',[num2str(i) ' ' num2str(j)]);
hold on
end
end
![ml_test.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/239292/ml_test.jpeg)
You get the plot similar as shown below
2 件のコメント
SaiDileep Kola
2019 年 9 月 24 日
It is nested for loop to select all posible pairs of t values without repetetion.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!