From: Christophe on
Hello,

In Matlab I have a column vector HM containing Time formated as HH:MM.
Size of HM is 1459x5 and its class is char.
When I export HM to Excel (using xlswrite) the result is 5 columns containing each 1 element of HH:MM.
For exemple for 1 row :
A B C D E
1 6 : 4 5
Instead of :
A
16:45

How could I obtain the result I want in Excel ?
Formating HM in Matlab ? (how)
Using options with xlswrite ? (which)

Thank you for tour help.
Christophe
From: kinor on
"Christophe " <christophe.montaurier(a)clermont.inra.fr> wrote in message <hphi1i$e76$1(a)fred.mathworks.com>...
> Hello,
>
> In Matlab I have a column vector HM containing Time formated as HH:MM.
> Size of HM is 1459x5 and its class is char.
> When I export HM to Excel (using xlswrite) the result is 5 columns containing each 1 element of HH:MM.
> For exemple for 1 row :
> A B C D E
> 1 6 : 4 5
> Instead of :
> A
> 16:45
>
> How could I obtain the result I want in Excel ?
> Formating HM in Matlab ? (how)
> Using options with xlswrite ? (which)
>
> Thank you for tour help.
> Christophe

Hi Christophe,
convert HM first to a cell array like

HMcell = mat2cell(HM, ones(size(HM,1),1),5);

and write it then to your xls-file.

hth
kinor
From: Christophe on
"kinor " <kinor.removethiswithdot(a)gmx.de> wrote in message <hphkeh$grj$1(a)fred.mathworks.com>...
> "Christophe " <christophe.montaurier(a)clermont.inra.fr> wrote in message <hphi1i$e76$1(a)fred.mathworks.com>...
> > Hello,
> >
> > In Matlab I have a column vector HM containing Time formated as HH:MM.
> > Size of HM is 1459x5 and its class is char.
> > When I export HM to Excel (using xlswrite) the result is 5 columns containing each 1 element of HH:MM.
> > For exemple for 1 row :
> > A B C D E
> > 1 6 : 4 5
> > Instead of :
> > A
> > 16:45
> >
> > How could I obtain the result I want in Excel ?
> > Formating HM in Matlab ? (how)
> > Using options with xlswrite ? (which)
> >
> > Thank you for tour help.
> > Christophe
>
> Hi Christophe,
> convert HM first to a cell array like
>
> HMcell = mat2cell(HM, ones(size(HM,1),1),5);
>
> and write it then to your xls-file.
>
> hth
> kinor

Hi kinor,
Great ! It works !
Thank you very much for your help.
Bye
Christophe