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

concatenation

71 views
Skip to first unread message

Januj Juneja

unread,
Feb 8, 2009, 12:01:03 AM2/8/09
to

Hi,

If I have the following cell contents:

>> CR(23)

ans =

'P-3'

>> CR(24)

ans =

'*-'

>>

Is there any way that I can make CR(23)='P-3*-', in other words, I would like to concatenate the contents of the above cells into one of the cell's contents. In excel, it is done by the concatenate function but how can I do it in matlab?

Thanks!!! I appreciate any help!

Matt Fig

unread,
Feb 8, 2009, 3:41:01 AM2/8/09
to
CR = {'P-3','*-'}

[CR{:}] % or [CR{23:24}] etc...

Januj Juneja

unread,
Feb 8, 2009, 12:32:03 PM2/8/09
to
Thanks!!


"Matt Fig" <spam...@yahoo.com> wrote in message <gmm5qt$7bf$1...@fred.mathworks.com>...

Divya satsangi

unread,
Feb 15, 2009, 11:17:01 PM2/15/09
to
Hii
Is it possible to concatenate a string and an integer in matlab. If yes then how? I tried using strcat but it didnt work out. For eg; I have a string 'A' and and an integer '1' and i want a result 'A1'. Then how can i do that. Using strcat the result is 'A ' which is not waht i want. Can someone plz help...

Shaun

unread,
Feb 15, 2009, 11:26:01 PM2/15/09
to
>> int = 1; str = sprintf('a%d',int)

str =

a1

>> ['a' num2str(1)]

ans =

a1

shaun

Divya satsangi

unread,
Feb 15, 2009, 11:32:01 PM2/15/09
to
"Shaun" <s...@s.com> wrote in message <gnapsp$s8l$1...@fred.mathworks.com>...
Thanks a lot shaun
0 new messages