Write matrix to a Tab-Delimited text file
50 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jake
am 16 Mär. 2020
Bearbeitet: dpb
am 17 Mär. 2020
Hello again,
I'm reading certain data from a csv file and I want to write some of the columns of the csv file to a tab delimited text file. So far, I have this;
[n, t, r] = xlsread('file.csv');
A = r(:,1);
L = r(:,5);
B = r(:,6);
M = [A, L, B];
And M is a 10×3 cell array. And it only contains numeric data.
I want to export this data to a tab delimited text file. Since I'm using MATLAB R2017a, I can't use writecell.
Any recommendations, documentations to refer of leads?
Thanks in advance!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
dpb
am 16 Mär. 2020
- If are only numeric values in those three columns, then why not use the numeric return values from n instead? Depending on the structure of the spreadsheet, the column numbers may not be 1,5,6, but pick the ones needed instead.
- Use dlmwrite('youroutputfile.dat',cell2mat(M),'\t');
3 Kommentare
Siehe auch
Kategorien
Mehr zu Text Files 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!