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


dpb
Posts:
7,876
Registered:
6/7/07


Re: Combine string matrix and integer matrix
Posted:
Aug 25, 2013 9:11 AM


On 8/25/2013 3:37 AM, Sincloe Brans wrote: > Wow... Excellent work! That does look good! > Appreciate your help mate!
I intended to do one other perturbation to show the difference between a cell of a character array and a cell array of strings...
>> c=cellstr([num2str(A) repmat(' ',size(A,1),1) char(B)]) c = '1 3 4 4 a b c' '3 3 4 5 a a a' '4 4 5 5 a c a' '5 4 4 5 a b c' >> c(1) ans = '1 3 4 4 a b c' >> c{1} ans = 1 3 4 4 a b c >>
I presume the first two above is where you were seeing the single quotes. But that's using either the whole array reference or standard parens which refer to the cell. The content of the cell is obtained by using the curly braces to dereference it as the last shows. This is generally the most convenient downstream as it returns the full character array w/ one subscript expression instead of having to write the trailing ',:' for the basic character array.




