How do I format adding columns to a matrix in a textfile or in general
Ältere Kommentare anzeigen
So I have a matrix that I am printing to a file that looks like this
1, 2, 3;
6, 7, 8;
11,12,13;
I want to add a two column vectors of the form
[4 ;9 ;14] and [5 ;10 ;15]
to make the updated file look like
1, 2, 3, 4, 5;
6, 7, 8, 9,10;
11,12,13,14,15;
I am running a while loop to get the column vectors so I either have to update the matrix i the while loop before printing it, I dont know the code syntax to do that, or update the matrix in the file after each while loop, this seems easier to place in my code, but I don't know the syntax on how to code this. If anyone could offer help on this issue I would appreciate it. (I dont know how to format matrices in this Q&A so I apologize if this question is hard to look at).
4 Kommentare
Stephen23
am 26 Jun. 2017
How to format text as monospaced code: add two leading spaces.
Andrew Shum
am 26 Jun. 2017
kollin poindexrer
am 26 Jun. 2017
kollin poindexrer
am 26 Jun. 2017
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrix Indexing 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!