Insert element in to array and resize.

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 ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by