plotting offset between data

조회 수: 8 (최근 30일)
boutros baqain
boutros baqain 2019년 9월 20일
댓글: SaiDileep Kola 2019년 9월 24일
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!

채택된 답변

SaiDileep Kola
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
You get the plot similar as shown below
  댓글 수: 2
boutros baqain
boutros baqain 2019년 9월 23일
thank you very much!! do you mind explaining the for loops for me so i can study it. i appreciate it
SaiDileep Kola
SaiDileep Kola 2019년 9월 24일
It is nested for loop to select all posible pairs of t values without repetetion.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by