File formatting in Matlab

Hi ,
I have a text file which has numerical data in the following format:
582 120
-116 -338
534 520
-279 -351
-423 428
581 502
581 -41
-134 277
131 -603
352 -432
181 590
110 -606
-44 429
504 -288
-123 -49
511 186
190 -514
510 541
29 -268
-502 502
-29 -366
439 115
350 425
603 582
-362 -47
-111 -367
I wan to edit the file such that I get the data in the following format:
582
120
-116
-338
534
520
-279
-351
-423
428
581
502
581
-41
-134
277
131
-603
352
-432
181
590
110
-606
-44
429
504
-288
-123
-49
511
186
190
-514
510
541
29
-268
-502
502
-29
-366
439
115
350
425
603
582
-362
-47
-111
-367
Any adcice on how to do this in matlab?

Risposte (1)

Stephen23
Stephen23 il 13 Dic 2018
Modificato: Stephen23 il 13 Dic 2018

0 voti

>> M = dlmread('temp0.txt');
>> M = M.';
>> dlmwrite('temp1.txt',M(:))
The test files are attached.

Categorie

Richiesto:

il 13 Dic 2018

Modificato:

il 13 Dic 2018

Community Treasure Hunt

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

Start Hunting!

Translated by