MATLAB: Hi People, I have a matrix, to put it in a simple manner I have taken a vector version of it. A = [1 1.2 2.42 3.2] The matlab output is : A = 1.0000 1.2000 2.4200 3.2000 1. How to get A = 1 1.2 2.42 3.2 ? 2. How can i then get 1, 1.2, 2.42, 3.2

matrix

Hi People, I have a matrix, to put it in a simple manner I have taken a vector version of it.
A = [1 1.2 2.42 3.2]
The matlab output is :
A = 1.0000 1.2000 2.4200 3.2000 .
How do I get
A = 1 1.2 2.42 3.2 ? 2.
How can i then get 1, 1.2, 2.42, 3.2 ? i.e '1,' in first column (value with a comma), '1.2,' in second column and so on..?

Best Answer

>> A = [1 1.2 2.42 3.2]; num2str(A,3)
ans =
1 1.2 2.42 3.2