Effacer les filtres
Effacer les filtres

How can I insert an image when publishing a document?

17 vues (au cours des 30 derniers jours)
Ezz El-din Abdullah
Ezz El-din Abdullah le 22 Août 2017
Commenté : Imola Fodor le 17 Mar 2022
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.

Réponses (3)

Jared Evans
Jared Evans le 10 Mar 2020
Also make sure it's on a new line. Took me an hour to figure out my mistake
%
% <<yourFile.jpg>>
  2 commentaires
Ammar Mohammed
Ammar Mohammed le 27 Fév 2021
thanks, saved alot of time!
Imola Fodor
Imola Fodor le 17 Mar 2022
hello, this should also work in the live editor? putting it in a code section?

Connectez-vous pour commenter.


KL
KL le 22 Août 2017
Modifié(e) : KL le 22 Août 2017
% <<yourFile.jpg>>
Make sure to save your image in the folder where your m-file is being published. More here .
  4 commentaires
Ezz El-din Abdullah
Ezz El-din Abdullah le 22 Août 2017
R2016a
.jpg
KL
KL le 23 Août 2017
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.

Connectez-vous pour commenter.


Jan
Jan le 22 Août 2017
This code inserts a generic image called FILENAME.PNG into your published output.
<<FILENAME.PNG>>

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by