From: Wuxing Gan on
I am seeking help for
(1) how to export an data array with a short format into a Microsoft Excel with bank format (only two decimal point).
for example, a=1.3435 into a=1.34;
when the command: format bank only output on desktop. I don't want to use sprintf or frpintf, because my data array is big.

(2) I also like to output the data into 'uitable' with two decimal point.

Thanks,
Wuxing
From: reza on
format is not a property of the variable. It is a setting for
displaying numbers in matlab console. So an "array with short format"
doesn't make sense. Array is either numeric or not. If numeric its
either of type double or not. If it is a double type, when exported
the full number (all decimals) are exported.

Your post is not clear as to weather you want the format to be 2
decimal points (in which case use format "0.00" in excel) or if you
what to disregard all numbers after the 2nd decimal point. If it is
the latter you'll need to process the array before exporting it to
excel. Use, round(), fix() or floor() in matlab.

/m

On Jul 31, 4:51 pm, "Wuxing Gan" <wuxing....(a)yahoo.com> wrote:
> I am seeking help for
> (1) how to export an data array with a short format into a Microsoft Excel with bank format (only two decimal point).
> for example, a=1.3435 into a=1.34;
> when the command: format bank only output on desktop. I don't want to use sprintf or frpintf, because my data array is big.
>
> (2) I also like to output the data into 'uitable' with two decimal point.
>
> Thanks,
> Wuxing