필터 지우기
필터 지우기

Compiled Matlab Application calls file

조회 수: 1 (최근 30일)
Benedikt Staneczek
Benedikt Staneczek 2018년 7월 31일
댓글: Benedikt Staneczek 2018년 8월 3일
Hello guys,
I want to build a Application with the Matlab Compiler that calls a specific .csv file and works with its data. Is threre any possibility to do so. At the momenent the apllication works fine with:
function test()
M = importdata('myfile.csv');
plot(M(:,1),M(:,2))
end
But I want it to be like:
function test()
files = dir('C:\Users\...\*.csv');
names = {files.name};
M = importdata(names{1,1});
plot(M(:,1),M(:,2))
end
In the process of compiling it Matlab forces me to put in the .csv as "file required for your application to run". But I want to call the file from outside the Application, to work with changing data.
looking forward to an answer

채택된 답변

Sean de Wolski
Sean de Wolski 2018년 7월 31일
Look at: mfilename, fullfile, fileparts, pwd, uigetfile
These functions allow you to build full or relative paths that are generic and will work inside of compiled applications.
  댓글 수: 1
Benedikt Staneczek
Benedikt Staneczek 2018년 8월 3일
Thanks a lot. Got a good work around from those functions.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by