Is there a way to open a PDF-file from the DocBlock instead of a text file in the MATLAB Editor in Simulink?

3 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Oct 2022
Edited: MathWorks Support Team on 14 Oct 2022
As of Simulink 6.0 (R14), you have the option of using RTF and HTML files in addition to TXT-files in the DocBlock. Below is the documentation for the Release 14 DocBlock:
For all versions of Simulink, you can also use an empty Subsystem block. Below are steps to do this:
1. Place a Subsystem block into the model.
2. Right-click on the block and choose "Format -> Hide name"
3. Open subsystem and delete contents
4. Right-click on block and choose "Mask subsystem". In the drawing commands window, you can set some text to show on the block (e.g., "PDF doc").
5. Change the OpenFcn callback to use the WINOPEN function. Right-click on block and choose "Block properties". On the Callbacks tab, choose OpenFcn and place code in right pane. Change the callback to, for example:
winopen('C:\Documents\mydocumentation.pdf')
Now, when the block is opened, the PDF-file will open. On non-Windows platforms, the MATLAB function SYSTEM can be used to obtain the same functionality.

More Answers (0)

Categories

Find more on Programmatic Model Editing 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!