adding a label to a list of values
Ältere Kommentare anzeigen
I have an m-file that will output a row of values to the same output file repeatedly, thus adding a new row each time I run this m-file. I need to label each new row with a unique identifier so later I remember which row corresponds to what set of data. Ideally I would like each row to look like this: Idenifier value1 value2 value3. However, I don't know where in my code I should add the identifier info to get the end result. Any ideas?
Here is the code I have so far, it's tested and it works.
p = [p1 p2 p3];
load('PlottingMatrix.txt');
plottingmatrix = PlottingMatrix;
plottingmatrix = [plottingmatrix
p];
dlmwrite('PlottingMatrix.txt', plottingmatrix)
Akzeptierte Antwort
Weitere Antworten (2)
Jenny
am 25 Sep. 2011
0 Stimmen
Jenny
am 25 Sep. 2011
2 Kommentare
Walter Roberson
am 25 Sep. 2011
count = fprintf(fid, '%s,%f,%f,%f\n', p{:});
Jenny
am 27 Sep. 2011
Kategorien
Mehr zu Text Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!