3

How can I create a link in Command Window for a block in a simulink model?

I found something like this:

    disp('<a href="matlab:magic(4)">Generate magic square</a>')

and that is possible to use href to jump to a line in a m-file. WHat is the syntacs to jump to a given block in a model? (I know in advance the block's gcb).

Remark I am not fixed on href solution.

Eagle
  • 3,362
  • 5
  • 34
  • 46

1 Answers1

3

Using hilite_system can use something like following :

fprintf('<a href="matlab:hilite_system(''%s'')">Jump to Block</a>\n' , gcb )
P0W
  • 46,614
  • 9
  • 72
  • 119
  • in addition, do you know how i could jump directly from my m-script to a given block? – Eagle Sep 12 '14 at 04:56
  • @Eagle Could you be specific ? M-Scripts are simple texts. For such navigation you need html document. – P0W Sep 12 '14 at 05:10
  • i have a M-Script that go over all blocks in my model and in case that it find a problem i would like to jump to this place. – Eagle Sep 12 '14 at 05:13
  • @Eagle Well in that case simply use above in try..catch block on error display the message, you accordingly _might_ have to update gcb input. Specific problem ask in new post. – P0W Sep 12 '14 at 05:29