Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

How to build a simple simulink standalone execution file?

Asked by Kelvin Oys on 3 Jan 2013
Latest activity Commented on by Kaustubha Govind on 9 Jun 2014

First of all i seen the video in http://www.mathworks.com.au/products/simulink-coder/examples.html on how build the code.

I try build a code myself, so I simply build a simulink model with a source sin wave and output of scope. Then i set the configuration\code generation\system file to rsim.tlc and then i started to build.

I got some error like

Cannot CD to C:\Users\KELVIN~1\AppData\Local\Temp (Name is nonexistent or not a directory). similar to this one http://www.mathworks.com.au/matlabcentral/answers/16478-error-using-cd. I think this is not the real problem, the real problem, the real problem is i think i don't think my procedure it right, or maybe something is missing on the model.

It will be best if you record a video on making a simple exe file. Or can you help me to look on this problem.

4 Comments

Suneesh on 3 Jan 2013

Do you observe the same when you: 1. CD to directory like 'c:\work' 2. Save the model to 'c:\work' 3. Build?

Kaustubha Govind on 3 Jan 2013

If you want to generate standalone C/C++ code from your model, grt.tlc or ert.tlc are more appropriate - what happens when you pick one of them?

Ryan G on 3 Jan 2013

Agree with Suneesh. Try to simplify the issue by using a simpler directory structure. There may be an issue somewhere between MATLAB and Windows trying to shorten the directory name (KELVIN~1).

Also agree with Kaustubha, grt.tlc is likely the most appropriate simulation target file if you only want to generate the fastest running EXE from Simulink.

Kelvin Oys

Tags

Products

3 Answers

Answer by Kelvin Oys on 21 Jan 2013
Accepted answer

Problem Found: The temporary memory got some problem and was unable to store space anymore.

Create another user and try run it with that user. It works

0 Comments

Kelvin Oys
Answer by Kelvin Oys on 8 Jan 2013

First of all the directory exist. I try saving my work on that directory, and build. Still not working. 1 weird thing, i can't see any file in that directory in matlab. But i check the folder i saw the mdl file, rsim.tlc folder ...etc for the simple model i build. I reinstall matlab. Still not working. I try on others computer it works fine.

It is a directory problem, but i ain't gonna reformat my computer for one minor problem. I asking how to change the location of generated code and exe file.

sorry for late reply, the system say if anyone reply me they will email me, but i didn't receive any email. My apology

0 Comments

Kelvin Oys
Answer by Kaustubha Govind on 9 Jan 2013

I suspect your TEMP environment variable is set to C:\Users\KELVIN~1\AppData\Local\Temp which Simulink Coder is trying to use. You can verify this either from the Windows Environment Variable window, or from the MATLAB prompt using the command "getenv TEMP". If this is the case, try changing it to a path that exists, restart MATLAB and try again.

PS: I think you get email notifications only if someone posts an answer. All of our notes were comments, not answers, which is probably why you did not get a notification.

4 Comments

Shady N on 24 Mar 2014

Dear Kaustubha Govind,

I have the same problem when I wish to start Simulink or open a Simulink model. I changed my user system variable (TEMP and TMP) multiple times. Everytime it work for some hours and then the exact same error occurs again. It's driving me nuts.

Will you please provide me with a solution?

R2014a, Windows 8.1 64bit

Gentian Licenji on 6 Jun 2014

I agree with Shady N. The solution is only temporary. I am having the same issue. I am also using R2014a, Windows 8.1 64bit

Kaustubha Govind on 9 Jun 2014

Shady, Gentian: You may want to contact Tech Support, so they can do further investigation.

Also, I would recommend setting the environment in the shell (Linux) or System Settings (Windows) - when you use the SETENV command in MATLAB, it only applies to that session of MATLAB.

Kaustubha Govind

Contact us