Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


dpb
Posts:
9,850
Registered:
6/7/07


Re: Combine string matrix and integer matrix
Posted:
Aug 23, 2013 7:43 PM


On 8/23/2013 2:13 PM, Sincloe Brans wrote: > Hi Saravanan > It works if I specify the items inside my B matrix as you described > ('a', 'b',...), however it is not in a matrix format though. > my B matrix keeps changing so I can only specify it as [B] or {B} while > concatenation. My output C = [A B] where A is integer matrix and B is > string matrix, dimensions are assumed to be same.
You _can't_ concatenate different types into the same array.
You _can_ make C a cell array w/ a numeric and a character array in the cells.
Or, you can convert all the numeric values to strings and create a larger character arraya cell array would probably be more handy.
What is the end result of this desired operation, pray tell? If you were describe what your actual objective is in the end instead of how to do what is essentially impossible a better solution may ensue.




