Borrar filtros
Borrar filtros

Compiled Matlab Application calls file

1 visualización (últimos 30 días)
Benedikt Staneczek
Benedikt Staneczek el 31 de Jul. de 2018
Comentada: Benedikt Staneczek el 3 de Ag. de 2018
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

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 31 de Jul. de 2018
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 comentario
Benedikt Staneczek
Benedikt Staneczek el 3 de Ag. de 2018
Thanks a lot. Got a good work around from those functions.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by