Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert Cell array to string

9,776 views
Skip to first unread message

Saad

unread,
Dec 9, 2006, 2:51:17 PM12/9/06
to
How can I convert 1x3 cell array A = {'ab' 'cd' 'ef'} to string?

I want to print cell array A on screen horizontally by text(X,Y,A)
where X and Y are x and y co-ordinates and A is cell array. At the
moment it is printing vertically on screen.

us

unread,
Dec 9, 2006, 3:38:40 PM12/9/06
to
Saad:
<SNIP cellstr2str...

some of the solutions

a={'ab','cde','fghi'};
as1=char(a) % note: a char mat
as2=cat(2,a{:}) % note: no spaces between cells
as3=sprintf('%s|',a{:}); % the most versatile
as3(end)=''

us

0 new messages