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:
adding image to matlab

Subject: adding image to matlab

From: m y

Date: 1 Sep, 2009 13:56:04

Message: 1 of 5

Hi
I have ploted three images from matlab and I have one other image from MS.excel.
Can I add this image (excel) to the position (2,2) in matlab figure window . for other three positions I have three figures from matlab.
Thanks

Subject: adding image to matlab

From: Dave Brackett

Date: 1 Sep, 2009 23:43:03

Message: 2 of 5

"m y" <ailojee@gmail.com> wrote in message <h7j95j$qpv$1@fred.mathworks.com>...
> Hi
> I have ploted three images from matlab and I have one other image from MS.excel.
> Can I add this image (excel) to the position (2,2) in matlab figure window . for other three positions I have three figures from matlab.
> Thanks


% Read in image of excel graph
excel_image=imread('your_excel_image.jpg');

figure % create figure

% Plot the matlab data in subplots 1, 3 and 4
matlab_subplot_handle1=subplot(2,2,1);
matlab_subplot_handle2=subplot(2,2,3);
matlab_subplot_handle3=subplot(2,2,4);

plot(1:10,1:10,'Parent',matlab_subplot_handle1)
plot(1:10,1:10,'Parent',matlab_subplot_handle2)
plot(1:10,1:10,'Parent',matlab_subplot_handle3)

% plot the excel graph image in subplot 2
excel_image_subplot_handle=subplot(2,2,2);
imshow(excel_image,'Parent',excel_image_subplot_handle)


hope that helps.

Subject: adding image to matlab

From: ImageAnalyst

Date: 2 Sep, 2009 01:18:40

Message: 3 of 5

I was thinking that he wanted to yank over some plot in Excel while
Excel is running as an ActiveX server. What you did was to merely
read in an image from a disk file like it was any other ordinary
image.

I know how to run Excel as an ActiveX server (see xlswrite1 on the
File Exchange) but I haven't pulled a chart that exists as a chart
object in Excel over into MATLAB. It can probably be done though.
You'd have to search through Excel's exposed methods and properties
for the appropriate methods to do this. Check the Microsoft Office
Developer web site:
http://msdn.microsoft.com/en-us/office/default.aspx

Subject: adding image to matlab

From: Dave Brackett

Date: 2 Sep, 2009 07:28:00

Message: 4 of 5

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <7bea4700-1088-4965-ab9f-bb4f222c0182@d23g2000vbm.googlegroups.com>...
> I was thinking that he wanted to yank over some plot in Excel while
> Excel is running as an ActiveX server. What you did was to merely
> read in an image from a disk file like it was any other ordinary
> image.
>
> I know how to run Excel as an ActiveX server (see xlswrite1 on the
> File Exchange) but I haven't pulled a chart that exists as a chart
> object in Excel over into MATLAB. It can probably be done though.
> You'd have to search through Excel's exposed methods and properties
> for the appropriate methods to do this. Check the Microsoft Office
> Developer web site:
> http://msdn.microsoft.com/en-us/office/default.aspx

true, i did think he meant simply to show an image of a graph from excel. the original post is not clear enough if he meant something else.

Subject: adding image to matlab

From: m y

Date: 3 Sep, 2009 16:27:00

Message: 5 of 5

"Dave Brackett" <davebrackett@hotmail.com> wrote in message <h7l6q0$mvu$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <7bea4700-1088-4965-ab9f-bb4f222c0182@d23g2000vbm.googlegroups.com>...
> > I was thinking that he wanted to yank over some plot in Excel while
> > Excel is running as an ActiveX server. What you did was to merely
> > read in an image from a disk file like it was any other ordinary
> > image.
> >
> > I know how to run Excel as an ActiveX server (see xlswrite1 on the
> > File Exchange) but I haven't pulled a chart that exists as a chart
> > object in Excel over into MATLAB. It can probably be done though.
> > You'd have to search through Excel's exposed methods and properties
> > for the appropriate methods to do this. Check the Microsoft Office
> > Developer web site:
> > http://msdn.microsoft.com/en-us/office/default.aspx
>
> true, i did think he meant simply to show an image of a graph from excel. the original post is not clear enough if he meant something else.

Thanks alot

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