I've read, tested this documentation and this example and tried on my own, but have not yet found a solution for the described issue.
According to the documentation, either the image file is on the same path of the used MATLAB script, in which case one could easily add it as described
% <<Filename.png>>
or one needs to add the full path:
% <<C:\\Fullpath\Filename.png>>
otherwise one would get an empty document (at least when publish
is creating .html files).
As the documented code should be shared I need a relative path to avoid later issues.
Is there any solution or workaround within MATLAB?
Some of my former attempts:
% <<.\Filename.png>> # with and without "" or ''
% <<..\Filename.png>> # with and without "" or ''
% <<..\..\Filename.png>> # with and without "" or ''
The image does not appear.
Assuming this directory structure:
This code,
function q51539865
%% Image From URL
%
% <<https://i.sstatic.net/zSPip.jpg>>
%
%% Image From Relative Path
%
% <<../InnerPath/zSPip.jpg>>
%
Produces the following web page:
When inspecting the 2nd image we see: