I have four part of data for chart drafting: T(t) and T3(t1)
t T t1 T3
0 20,25 0 20,25
0,1 20 0,05 19,75
0,2 19,75 0,1 19
0,3 19,25 0,15 17,5
"t" have 0,1 tick but "t1" have 0.05 tick. I want sort the data in loop like this:
t T t1 T3
0 20,25 0 20,25
0,05 NaN 0,05 19,75
0,1 20 0,1 19
0,15 NaN 0,15 17,5
0,2 19,75 0,2 15,75
0,25 NaN
0,3 19,25
arrayThat means, that i must insert a row between every 2 rows in t and T and add data. Anyone have any idea how I can do it?

 채택된 답변

Sebastian Owarzany
Sebastian Owarzany 2020년 4월 8일

0 개 추천

I find the solution on "for" loop many time ago:
T01 = zeros(299, 1);
T11 = zeros(299, 1);
T21 = zeros(299, 1);
for i = 1:1:150
T01(2*i-1) = T(i);
T11(2*i-1) = T1(i);
T21(2*i-1) = T2(i);
end
for i = 1:1:299
if T01(i) == 0
T01(i) = NaN;
T11(i) = NaN;
T21(i) = NaN;
end
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by