How can I provide a hyperlink to a particular line in an MATLAB file using the HTML tags in MATLAB?

7 vues (au cours des 30 derniers jours)
I wish to provide a hyperlink to a particular line in the MATLAB file similar to the error messages that are displayed at the MATLAB Command Prompt with the hyperlink to the line containing error in the MATLAB file.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 16 Jan 2010
The OPENTOLINE function in MATLAB allows you to go to a particular line number in a MATLAB file. This function takes in the file name (along with extension) and the line number as arguments. For help on this function, type the following at the MATLAB Command Prompt:
doc opentoline
You can use this function along with HTML tags to create a hyperlink to direct the cursor to go to a particular line in your MATLAB file
For instance, if you have a file named 'test.m', then you can use the following command to go to line 5:
disp('<a href="matlab:opentoline(''test.m'',5)">go</a>')

Plus de réponses (0)

Catégories

En savoir plus sur Adding custom doc dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by