Hyperlink in Excel cell to open Simulink model?

1 visualización (últimos 30 días)
Jerki Jokne
Jerki Jokne el 4 de Mayo de 2020
Editada: Jonas el 7 de Mayo de 2020
Hello, I realize that this may be more of an Excel related question, but perhaps someone from this forum has already done what I am trying to do. I would like to create a hyperlink in Excel that will open a Simulink model. So basically I would have a cell with the text sldemo_fuelsys, and it would be hyperlinked to run the Simulink command open_system('sldemo_fuelsys'); Is this possible? Admittedly I have never created a macro in Excel, so I am not an expert in Excel. Thank you for your help in advance!

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 5 de Mayo de 2020
In Excel, you can "Insert Link", "Existing file or web page", navigate to find the .slx or .mdl model file. When you click it, it will follow the default Windows program to run MATLAB, and then open the Simulink model.
  2 comentarios
Jerki Jokne
Jerki Jokne el 5 de Mayo de 2020
Thanks! This will link to a model. Would it be possible to link to a block, so that when I click the link in Excel it runs the hilite_system command?
Fangjun Jiang
Fangjun Jiang el 6 de Mayo de 2020
I can't think of a decent way to do it.

Iniciar sesión para comentar.

Más respuestas (1)

Jonas
Jonas el 7 de Mayo de 2020
Editada: Jonas el 7 de Mayo de 2020
You can launch Matlab from Windows system prompt, see the documentation. Maybe you can find a way to execute a command line code from Excel, and then find the correct command line to use the 'hilite_system' command. Maybe this can help.

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by