how to append a semicolon at the end of each element of a matrix ?

2 views (last 30 days)
appending semicolon

Answers (1)

Star Strider
Star Strider on 24 Jun 2017
If you put a semicolon at the end of each element, you create a column vector in MATLAB syntax. It would be easier to just create the column vector and be done with it.
If you want to save your matrix to a text file and want to use the semicolon as the delimiter, use the dlmwrite (link) function and specify:
dlmwrite('myFile.txt',MyMatrix,'delimiter',';');

Community Treasure Hunt

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

Start Hunting!