Matlab Function Block with error generated by Stateflow
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have been trying to use "Matlab Function" block for hours using very simple example from this link http://www.mathworks.co.uk/help/simulink/ug/creating-an-example-model-that-uses-a-matlab-function-block.html (see attached file), however I keep getting this errors reported by "Stateflow" (The weird thing is I do not use Stateflow): Error using construct_error (line 108) The current directory is d:\program files\matlabr\bin, which is reserved for MATLAB files.
Please change your current directory to a writable directory preferably outside of MATLAB installation area.
What I have done:
1. Change to other directory outside of Matlab installation area
2. mex set up to select the correct compiler in my system (Microsoft Visual 2010)
3. Generate Code for the MATLAB Function Block by selecting Build Model > Build to compile and build the model.
I have no idea what went wrong, I am pretty sure this should be a very common issue, I keep searching high and low in the internet for the solution but to no avail...
Could you please suggest the possible cause of the problem?
Many thanks in advance.
0 Kommentare
Akzeptierte Antwort
Kaustubha Govind
am 10 Jul. 2013
The MATLAB Function block and Stateflow share some common infrastructure, which is why you will sometimes see error messages as being reported by Stateflow. I'm surprised that you still see the same error even after changing the current working directory outside of MATLAB installation area though. What does running the command "pwd" at the MATLAB prompt return?
5 Kommentare
Kaustubha Govind
am 11 Jul. 2013
The MATLAB Function block automatically generates C code from the MATLAB code for execution - this code is generated into the current working directory - and hence can "litter" your current working directory. In general, it is bad practice to litter the installation area with user data, which is why the error message is used to discourage this. Note that on newer Windows systems for instance, you need admin privileges to write to the "Program Files" directory.
It's not clear what you are asking in your second question. Are you saying that you are getting dimension propagation errors when using an S-function? If so, you may not have configured your S-function properly. However, this is a longer discussion, and if you would like to continue it, please create a new question.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Simulink Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!