How can I provide a hyperlink to a particular line in an MATLAB file using the HTML tags in MATLAB?
17 views (last 30 days)
Show older comments
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.
Accepted Answer
MathWorks Support Team
on 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>')
0 Comments
More Answers (0)
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!