Matlab array of char to string

If I had for example the char array in Matlab,

A(1,1) = 'A'
A(1,2) = 'P'
A(1,3) = 'R'
A(2,1) = 'M'
A(2,2) = 'A'
A(2,3) = 'Y'

How would I convert this to a string cell, B such that

B{1} = 'APR'
B{2} = 'MAY'

Many Thanks

Edit: A is a cell and using the function cellstr gives the error

Error using cellstr (line 23)
S must be 2-D. 

Answers


Use the following function: http://www.mathworks.com/help/matlab/ref/cellstr.html

>> B =  cellstr(A)

B = 

    'APR'
    'MAY'

>> B{1}

ans =

APR

Need Your Help

Laravel Eloquent Array Loop

php arrays laravel collections eloquent

I have an eloquent query that is returning a 'show', and any 'show_ref's relating to it:

Using Geonames service and Facebook authentication in the same app (are they mutually exclusive?)

asp.net-mvc facebook security ssl oauth

I have been using geonames autocomplete service with very good results while my asp.net mvc5 website was configured with an "insecure connection" (SSL Disabled - http://).

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.