matlab matrix to ascii with blank rows
Ältere Kommentare anzeigen
Hello,
I'm trying to export a matrix to ascii file, to then plot it using GNUPLOT. To plot a surface, I would need a matrix with blank rows in it, something like:
A(1) B(1) C(1, 1)
A(1) B(2) C(1, 2)
A(1) B(3) C(1, 3)
A(2) B(1) C(2, 1)
A(2) B(2) C(2, 2)
A(2) B(3) C(2, 3)
but I can't find any documentation about it.
Any idea?
Thanks in advance
3 Kommentare
Paulo Silva
am 14 Feb. 2011
You can't have blank elements in a matrix, use cell instead.
Matt Tearle
am 15 Feb. 2011
My question would be: why not just plot in MATLAB?
maurizio
am 16 Feb. 2011
Akzeptierte Antwort
Weitere Antworten (2)
Igor
am 14 Feb. 2011
0 Stimmen
better than fprintf :)
dlmwrite
2 Kommentare
Oleg Komarov
am 14 Feb. 2011
You can't use dlmwrite if the OP is actually trying to write A(1,1) and not the element itself ata that position.
And easier to use maybe, don't know about better.
Walter Roberson
am 14 Feb. 2011
And you aren't going to get the blank lines in dlmwrite() unless you loop using the row offset and the -append option. fprintf() would be easier.
maurizio
am 15 Feb. 2011
Kategorien
Mehr zu Programming 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!