I imported two columns of data from a txt file but it came in as one column who can i split them up
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ben Johannesson
am 5 Mai 2015
Beantwortet: Azzi Abdelmalek
am 5 Mai 2015
Is there a function i can use to split the dingle columns in two. I tried calculating the remainder of each entry number ( 1 2 3 4 etc) and moving into a separate matrix but it did not work. here is my code:
- A is a 1x12882 matrix where the odd number should be in the Thick column and the even numbers should be in the Thin columns
for i = length(A)
t= rem(i,2);
if t == 1
Thick(i)=A(i);
else
Thin(i) = A(i);
end
end
t=5
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 5 Mai 2015
a=[1;2;4;6;5;1;2;7;8;10]
idx=rem(a,2)==1
a1=a(idx)
a2=a(~idx)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!