필터 지우기
필터 지우기

Printing pathname to GUI textbox

조회 수: 4 (최근 30일)
qiana curcuru
qiana curcuru 2018년 1월 30일
댓글: qiana curcuru 2018년 1월 30일
I am new at making GUIs and I am using App Designer. I am trying to get a file using uigetfile, and then have the chosen pathname appear in an edit textbox. This is my code below, I am not getting any errors, and the pathname prints to the command window, but the pathname is not printing to the editbox. I am wondering if these commands should be done int the same callback as the button that calls the uigetfile command, or the callback of the editbox itself. Dir is the name of the editbox I am trying to write to.
% code
function BrowseButtonPushed(app, event)
[filename, pathname, filterindex] = uigetfile({ '*.mat','MAT-files (*.mat)'; ...
'*.slx;*.mdl','Models (*.slx, *.mdl)'; ...
'*.*', 'All Files (*.*)'}, ...
'Pick a file', ...
'MultiSelect', 'on');
disp(pathname)
set(app.dir.Value,'String', num2str([filename,pathname]))

채택된 답변

Birdman
Birdman 2018년 1월 30일
See the attached app. Run it and see the Code behind it. Actually it is really easy, I assumed you missed some points of it. Hope this helps.
  댓글 수: 1
qiana curcuru
qiana curcuru 2018년 1월 30일
Perfect, thank you so much! Wish I knew it was so simple haha

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by