Compiled Matlab Application calls file
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
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.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!