필터 지우기
필터 지우기

CD statment and connection from matlab to C# ?

조회 수: 1 (최근 30일)
sara selim
sara selim 2015년 5월 23일
댓글: Walter Roberson 2015년 5월 25일
i have created matlab file (function) which contains save statment i have to save image histogram value(Hist)
folder_name= 'query' ;
addpath(folder_name);
file_name = [folder_name 'image(1)'];
save(file_name,'Hist');
this runs perfectly using matlab with no problem the problem occurs when i run the code using C# after converting the matlab file to .dll file it cannot addpath to folder_name or find it although i have added the folder to the package of deployment tool
  댓글 수: 6
sara selim
sara selim 2015년 5월 24일
i have created 2 folder the fist contains all functions i have to use the the other is called query to save the image histogram into transposition between files into matlab is easy but after converting it to .dll file and use it with C# app i have an exeption that the query file doesnot exist so cannot save the file
Jan
Jan 2015년 5월 24일
I do not understand your comment. Please prefer short sentences to allow non-native speakers to follow.

댓글을 달려면 로그인하십시오.

답변 (2개)

Walter Roberson
Walter Roberson 2015년 5월 24일
When you use MATLAB Compiler to generate code, the code is not executed in the directory that it was originally compiled in, and the code is not executed in the directory that the user is in when they invoke the executable by name from a command window, and the code is not executed in the home directory of the user who clicked on an icon to launch the executable.
When you use MATLAB Compiler to generate code, then at run-time a temporary directory is created and the components are extracted into the directory, and the code is run from that directory. The root of that directory can be found using the function ctfroot(). Unfortunately I cannot look at the documentation for ctfroot. See http://www.mathworks.com/matlabcentral/answers/59148-for-stand-alone-exe-how-do-i-include-a-folder-of-files-and-know-how-to-access-them
  댓글 수: 4
sara selim
sara selim 2015년 5월 25일
finally it works thank you very much for your useful help
Walter Roberson
Walter Roberson 2015년 5월 25일
Please mark the Answer as accepted.

댓글을 달려면 로그인하십시오.


Jan
Jan 2015년 5월 24일
Beside the confusing usage of "folder_name" and "foldername" as functions or variables, there is no need to call addpath(folder_name) . Simply omit this line, when the rest is working as wanted.
  댓글 수: 1
sara selim
sara selim 2015년 5월 24일
folder_name is variable which contains the name of the folder which i wanna to save the image histogram into

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by