Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Saving figures to Excel

Subject: Saving figures to Excel

From: Anthony

Date: 17 Sep, 2007 20:38:40

Message: 1 of 4

Is there a feature in MATLAB that will allow me to save a
figure to an Excel sheet, just like xlswrite where I give
it a cell to save it to

Subject: Saving figures to Excel

From: Yair Altman

Date: 17 Sep, 2007 20:55:31

Message: 2 of 4

"Anthony " <anthony.campos@baesystems.com> wrote in message
<fcmokg$n4l$1@fred.mathworks.com>...
> Is there a feature in MATLAB that will allow me to save a
> figure to an Excel sheet, just like xlswrite where I give
> it a cell to save it to

Use OfficeDoc on the file Exchange:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=15192

Yair Altman
http://ymasoftware.com

Subject: Saving figures to Excel

From: Anthony

Date: 18 Sep, 2007 13:53:34

Message: 3 of 4

I tried the officedoc command
[file,status,errMsg] = officedoc
('tx_compare_rates.xls', 'open', 'mode','append');
status = officedoc(file,'write',rate2,'H1:P23',
[figsavemag '.fig']);

 and received the following error:
??? Error setting officedoc property '6 MHz':
Invalid field name: '6 mhz'.

Error in ==> tx_compare_rates at 135
status = officedoc(file,'write',rate2,'H1:P23',
[figsavemag '.fig']);

I want to write a bitmap or the .fig file to the H1 cell,
to the rate2 sheet, where rate2 = '6 Mhz', and file









"Anthony " <anthony.campos@baesystems.com> wrote in message
<fcmokg$n4l$1@fred.mathworks.com>...
> Is there a feature in MATLAB that will allow me to save a
> figure to an Excel sheet, just like xlswrite where I give
> it a cell to save it to

Subject: Saving figures to Excel

From: Yair Altman

Date: 18 Sep, 2007 18:47:26

Message: 4 of 4

> status = officedoc(file,'write',rate2,'H1:P23',[figsavemag
'.fig']);
>
> and received the following error:
> ??? Error setting officedoc property '6 MHz':
> Invalid field name: '6 mhz'.

Following 'write', you need to specify properties in
name-value (P-V) pairs. In your case:

status=officedoc(file,'write','sheet',rate2,'range','H1:P23','image',myImage);

the supplied myImage parameter may be an image filename or a
handle to a Matlab figure.

Yair Altman
http://ymasoftware.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us