How to separate a column into two table of multiple columns?
Afficher commentaires plus anciens
Hello! And thank you for helping! I have a double column that looks like this:
A
58
18
18
48
18
NaN
NaN
NaN
18
15
NaN
NaN
Of more than 16000 rows. I would like to be able to separate the indexes in two tables, one table for the indexes of values and one table for the indexes of NaN. Moreover, I would like it to change column each time the value passes to a NaN and vice versa, as seen below:
Table of values:
1 9
2 10
3
4
5
and the table of Nan would be:
6 11
7 12
8
I tried this but it doesnt work:
index1=5990; % start row for the sum of hours
index2=6068; % end row
i2=1;
i3=1;
i4=1;
i5=1;
for i1=index1:index2
if ~isnan(ActivePuissance(i1,1))
Fidx(i2,i3)=i1;
i2=i2+1;
else
NFidx(i4,i5)=i1;
i4=i4+1;
end
% i3=i3+1;
%i5=i5+1;
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Tables dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!