필터 지우기
필터 지우기

Change a directory file from App Designer Matlab

조회 수: 8 (최근 30일)
Franco
Franco 2023년 6월 21일
댓글: Franco 2023년 6월 22일
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

채택된 답변

Florian Bidaud
Florian Bidaud 2023년 6월 21일
편집: Florian Bidaud 2023년 6월 21일
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
  댓글 수: 1
Franco
Franco 2023년 6월 22일
Thanks for the proposition its working for me !

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by