Azzera filtri
Azzera filtri

matrix manipulation

1 visualizzazione (ultimi 30 giorni)
gianluca
gianluca il 18 Apr 2012
Hi, I've an ASCII file like this
450 1 2 3 4 5
6 7 8 9 10 11
12 13
451 1 2 3 4 5
6 7 8 9 10 11
12 13
452 1 2 3 4 5
6 7 8 9 10 11
12 13
...
and I would modify it to obtain a file like this
450 1 2 3 4 5 6 7 8 9 10 11 12 13
451 1 2 3 4 5 6 7 8 9 10 11 12 13
452 1 2 3 4 5 6 7 8 9 10 11 12 13
Any suggestions? Thanks Gianluca

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 18 Apr 2012
f = fopen('test.txt');
c = textscan(f,'%f');
fclose(f);
out = reshape(c{:},[],3)'

Più risposte (0)

Categorie

Scopri di più su Graph and Network Algorithms in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by