Make error when using a embedded matlab function

1 次查看(过去 30 天)
I wrote a simple function to swap variables. I am using MATLAB in Win 7.
function [x,y]= swap(u,v)
x=v;
y=u;
I get a make error stating
"Making simulation target "ex2_sfun", ...
C:\Users\....(some location)>"c:\users\(some location)" -f ex2_sfun.lmk The system cannot find the path specified."
I get Parse Ok and Code Ok.
What might be the problem? Please help me.
  5 个评论
Anand
Anand 2013-4-1
Hi.. By System PATH u mean the Path variable in Environmental variables of computer properties? I added in that and still it not working. Again it is giving me Make Error.
Kaustubha Govind
Kaustubha Govind 2013-4-1
Now, when you run "getenv PATH" from MATLAB, does "C:/Windows/System32/" show up in the list?

请先登录,再进行评论。

回答(1 个)

Ahmed A. Selman
Ahmed A. Selman 2013-3-28
Probably there is a simulink model with the same name. Try to use a slightly different function name for youe swap function such as swap01 or swapThem..etc. Also check your path and set it to current Matlab directory. Regards.
  3 个评论
Ahmed A. Selman
Ahmed A. Selman 2013-3-29
From Matlab menu (File), then goto (Set Path) and click on (Add Folder) to add a single directory or (Add with subfolders) to add a folder and its children. You can also type
pathtool
to reach the same interface.
Don't forget to click (save) after you finish setting your path :)
Anand
Anand 2013-4-1
I notice tat the path is already set to the present directory. But when I run the model, it gives me a Make Error.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by