Borrar filtros
Borrar filtros

Change a directory file from App Designer Matlab

8 visualizaciones (últimos 30 días)
Franco
Franco el 21 de Jun. de 2023
Comentada: Franco el 22 de Jun. de 2023
Hi all,
I am working on the App Designer Matlab and I would like to move a file from a folder to another not manually. Indeed I am building an app that get as input a filename and provide as output relocating this file in a some folder.
Please help !
thanks

Respuesta aceptada

Florian Bidaud
Florian Bidaud el 21 de Jun. de 2023
Editada: Florian Bidaud el 21 de Jun. de 2023
You can use movefile function in a button, here called move_file, two edit fields, one for the file to move, the other for the destination path, and create the function handlers as follows:
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: move_file
function move_filePushed(app, event)
movefile(app.file_name.Value,app.new_path.Value)
end
% Value changed function: file_name
function file_nameValueChanged(app, event)
value = app.file_name.Value;
end
% Value changed function: new_path
function new_pathValueChanged(app, event)
value = app.new_path.Value;
end
end

Más respuestas (0)

Categorías

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

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by