How can i convert a matrix to a specific feature with matlab
1 view (last 30 days)
I need desperately your help as I am not very familiar with Matlab. Let assume that I have two matrixes for instance
b=[25;25;55;65;65] (dimension 5x1 each one)
What I want to do is to take the numbers from each row of the matrixes a and b and have a new one with a specific feature like
c=[205 25,165 25,175 55,165 65,135 65]
In more general I want to have a new matrix
C=[a11 b11,a21 b21,a31 b31,…aj1 bj1,…ai1 bi1]
if the a and b matrixes have ix1 dimension . Also bear in mind that C matrix has a specific feature as I have mentioned so far. What I mean with this is between some aj1 and bj1 there is a space gap and each pair let say a21 b21 and a31 b31 is separated by a comma (,).
Thanks everybody for your help
Guillaume on 18 Dec 2015
Spaces, commas, semicolons are all syntactic elements that are not part of the data that is stored in a matrix. It's only used as for display and input. As far as matlab is concerned a matrix is just a bunch of numbers.
Therefore, your specific feature is not possible. spaces and commas mean the same thing when you input a matrix and matlab displays them both as space. semicolons mark the end of a row, when you input a matrix and matlab displays that as a new line.
It sounds like you're confusing the display of a matrix with the content. As said, a matrix is just numbers. spaces and commas do not feature into it.