Info

This question is closed. Reopen it to edit or answer.

Use EmbeddedMatlab function without stateflow

2 views (last 30 days)
Niklas Nylén
Niklas Nylén on 9 Sep 2011
Closed: MATLAB Answer Bot on 20 Aug 2021
I have developed an application on a computer that that has StateFlow, even though the application does not use stateflow.
When I try to run the application on another computer that does not have StateFlow installed, I get an error on my EmbeddedMATLAB Functions, saying that StateFlow is missing.
I have attempted to just remove the StateFlow path from my development computer. This makes it impossible to insert EmbeddedMATLAB blocks at all ('Bad Link').
Does anyone know how to get to the ordinary EmbeddedMATLAB block back?
  6 Comments
Fangjun Jiang
Fangjun Jiang on 12 Sep 2011
To be clear, after you remove the Stateflow path from your development computer, can you go to simulink library->User-Defined Functions and drag/drop a usable "Embedded MATLAB Function" block?
Niklas Nylén
Niklas Nylén on 15 Sep 2011
No I can not.
If I run
rmpath('C:\Program Files (x86)\MATLAB\R2010a\toolbox\stateflow') and then open the simulink library, I get 'Bad link' if I drag-and-drop User-Defined Functions -> Embedded MATLAB Function into a model.
I made two screenshots from after I have removed the stateflow path. The first one is how it looks in the library (block still there) and the second one is how it looks if I drag-and-drop it in a model: http://imgur.com/a/PrrZH

Answers (1)

Fangjun Jiang
Fangjun Jiang on 9 Sep 2011
In R2011a, Embedded MATLAB functions have been renamed as MATLAB functions in Stateflow charts. I guess if you develop the model in old version but then move to a different computer with the new version of MATLAB, it's going to automatically convert the model and look for the Stateflow.
  3 Comments
Fangjun Jiang
Fangjun Jiang on 9 Sep 2011
See update in the answer. What are the MATLAB versions in your two computer?
Niklas Nylén
Niklas Nylén on 9 Sep 2011
I am using the same version, R2010A, on both computers. If I "remove" StateFlow from my main computer by removing the path, I get the same error on that computer. It seems like StateFlow has completely replaced the Embedded Matlab block in the Simulink library since I get 'Bad Link' if I remove the Stateflow paths.

This question is closed.

Community Treasure Hunt

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

Start Hunting!