How can I insert an image when publishing a document?

I would like to publish a MATLAB code into an html and pdf files and I want to insert an image from my computer into the code i.e. NOT a figure from MATLAB.

답변 (3개)

Jared Evans
Jared Evans 2020년 3월 10일

1 개 추천

Also make sure it's on a new line. Took me an hour to figure out my mistake
%
% <<yourFile.jpg>>

댓글 수: 2

thanks, saved alot of time!
hello, this should also work in the live editor? putting it in a code section?

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

KL
KL 2017년 8월 22일
편집: KL 2017년 8월 22일
% <<yourFile.jpg>>
Make sure to save your image in the folder where your m-file is being published. More here .

댓글 수: 4

I did that but didn't show the image just produced unknown icon on the html format and produced nothing in the pdf file.
KL
KL 2017년 8월 22일
Which version of Matlab are you using and what's the extension of your image file?
R2016a
.jpg
KL
KL 2017년 8월 23일
I tried it on R2015a as well, it works with a jpg file. Probably you're not putting it under a separate section..
<<image1.jpg>>
<<image2.jpg>>
<<image3.jpg>>
and all these images should be in the publishing folder.

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

Jan
Jan 2017년 8월 22일
This code inserts a generic image called FILENAME.PNG into your published output.
<<FILENAME.PNG>>

카테고리

도움말 센터File Exchange에서 Scripts에 대해 자세히 알아보기

태그

질문:

2017년 8월 22일

댓글:

2022년 3월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by