|
"Robin Jens" wrote in message <ifplth$i0$1@fred.mathworks.com>...
> Hello everybody
>
> I have the following example:
>
> cellaray1={'Heineken' 'Carlsberg'}
>
> Price={10 30}
>
> strcat(cellaray1,{'-'},Price)
>
> I get:
>
> >> strcat(cellaray1,{'-'},Price)
>
> ans =
>
> [1x10 char] 'Carlsberg-'
>
> I want:
>
> Heineken-10
> Carlsberg-30
>
> The problem is the numeric data in Price.
>
> Best Regards
>
> Robin Jens
You have the convert 30 to '30'.
Try char([10,30]) and see what happens (hint: google for an ascii table).
To convert a number to its correspondent string form use sprintf('%d',10) or num2str(10).
I also suggest to store the prices in a double array rather than in a cell.
Oleg
|