Opening htm at internal bookmark

4 visualizaciones (últimos 30 días)
berfri
berfri el 23 de Ag. de 2016
Respondida: Sameer el 14 de Mayo de 2025
I like to open a htm file at a specific bookmark from an m-file. The file is test.htm with internal bookmarks like #Help35. The command
open('test.htm')
is working and opens den Matlab Browser. The command
open('test.htm#Help35')
causes am error message 'file .. not found'. How can I open the htm-file directly at the specified internal bookmark?

Respuestas (1)

Sameer
Sameer el 14 de Mayo de 2025
The command open('test.htm#Help35') does not work in MATLAB, because open searches for a file with the exact name, including the #Help35 fragment, which does not exist.
To open an HTML file at a specific bookmark, the "web" function can be used with a properly constructed file URL.
Here's how you can do it:
filename = fullfile(pwd, 'test.htm');
url = ['file:///' strrep(filename, '\', '/') '#Help35'];
web(url);
Hope this helps!

Categorías

Más información sobre MATLAB Report Generator en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by