MATLAB Answers


How to write images to excel speadsheet from matlab?

Asked by Mini
on 29 Dec 2012

Hi there

I was wondering if there's a way to insert rows and columns of images in a excel spreadsheet using matlab. Please help me out. Thank you!




No products are associated with this question.

1 Answer

Answer by Image Analyst
on 29 Dec 2012

There is no way to export an image from MATLAB to Excel, unless you do some very complicated ActiveX stuff. I put thumbnail images into Excel but I wrote a Visual Basic program to do it. My MATLAB function passes the workbook filename and the image filename to the VB program. The VB program then launches Excel and reads in the workbook, reads in the image file and creates a thumbnail of it, and then finally exports the thumbnail image onto the worksheet. You see an actual image displayed in Excel.

If you want to put just THE VALUES of the image into a workbook, then you can use xlswrite. You won't get an image in the workbook but you will get pixel values (integers or some other type of number) in the Excel cells.

You might also be interested in Steve Eddins's im2html():


Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!