Change of Matlab Directory

Asked

Viewed 240 times

0

I would like to know how I fix this problem; I am using a function block inside Simulink, however when I click to execute my code appears the following error:

The Current directory 'c: program files Matlab Matlab Production server r2015a bin' is reserved for MATLAB files.

Please change your Current directory to a writeable directory Outside of the MATLAB installation area. Component: Stateflow | Category: General error

You could help me solve this problem ?

BS: I am new here and very inexperienced in programming languages, sorry if I was not so clear in my doubt.

1 answer

0

This is normal according to what you want to do in Matlab.

If you don’t have any scripts or anything like that, change the Matlab directory in the same interface, either as "Unix" directly at the command prompt (cd C:\Users\SEU_NOME) or with the same mouse. Above your name is your default windows directory, but maybe use some other directory you created along with its respective path (for example C:\MEUS_TESTES\TESTE1).

If your simulation relies on the scripts and files you created, transfer these files to the directory you want to run, change the directory in Matlab (Matlab does this automatically depending on how you open and run the files) and start running from there. Beware of dependency you may have created, such as running simulations and asking to write to a specific directory or calling a file the entire way.

An important point, Matlab automatically calls the functions of its library, but other functions or scripts that have been created must be in the same directory that is being run or in some folder that is in the path of Matlab. The path is a list of directories that a system will automatically search for programs. Matlab has its own path that makes available your libraries, it can be changed in the settings. I do not recommend changing the path by anything, because your functions may have preference over functions of the same name of the Matlab library, and in the future this may give problems.

If this has not solved, leave comments that I can try to see what the problem.

  • 1

    I managed to solve my problem, my friend, thank you very much for your help !

  • @Felipevieira Anything, in this case, if the answer is according to what you want, think about accepting it, after all this is one of the ideas of stackoverflow! If not what you want, be free to make more comments or edit the question. : D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.