Info

此问题已关闭。 请重新打开它进行编辑或回答。

Use EmbeddedMatlab function without stateflow

1 次查看(过去 30 天)
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 个评论
Fangjun Jiang
Fangjun Jiang 2011-9-12
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 2011-9-15
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

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2011-9-9
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 个评论
Fangjun Jiang
Fangjun Jiang 2011-9-9
See update in the answer. What are the MATLAB versions in your two computer?
Niklas Nylén
Niklas Nylén 2011-9-9
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.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by