필터 지우기
필터 지우기

Change Excel Number Format From Matlab

조회 수: 21 (최근 30일)
George
George 2011년 10월 7일
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.
George
George 2011년 10월 7일
It's fine. thank you very much

댓글을 달려면 로그인하십시오.

추가 답변 (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