Change Excel Number Format From Matlab

21 次查看(过去 30 天)
Hi
How to change excel number format to 2 decimal places from matlab using actxserver?
For example:
e = actxserver('Excel.Application');
eWorkbook = e.Workbooks.Add;
e.Visible = 1;
eSheets = e.ActiveWorkbook.Sheets;
eSheet1 = eSheets.get('Item', 1);
eSheet1.Activate;
eActivesheetRange = e.Activesheet.get('Range', 'A1');
eActivesheetRange.Value = 0.022432;
eActivesheetRange.NumberFormat = ????
I want excel to displa 0.02
Thanks
George
  3 个评论
George
George 2011-10-7
Sorry but i don't know how to use proper code formating
Fangjun Jiang
Fangjun Jiang 2011-10-7
When you post your question, look at the {}Code button above the text box.

请先登录,再进行评论。

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-10-7
eActivesheetRange.NumberFormat='0.00'
  6 个评论
Fangjun Jiang
Fangjun Jiang 2011-10-7
Okay, maybe that's a MS Office version thing.
I never had experience plot to Excel via MATLAB.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Use COM Objects in MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by