Load output files and display file names on the uitable for file selection at app designer
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to load output files to select some files to compare.
- First, read files like below (It was OK)
function [A D] = file_read(app);
[file_p, pathname] = uigetfile( ...
{'*.mat','MAT-files (*.mat)'},...
'Pick a file');%
load(file_p);
app.EditField.Value = file_p;
end
2. Next, I want to display selected file names on the uitable(UIFigure) to choice files for compare
I tryed like below but not found solutions yet.
function AddButtonPushed(app, event)
d_num = [];
app.d{d_num+1} = {true, app.EditField.Value} ;
uit = uitable(app.UIFigure,'ColumnWidth',{50,'auto'},'ColumnEditable',[true false]);
uit.ColumnName = {'Select','File name'};
uit.Data = app.d{:,:};
uit.ColumnSortable = true;
uit.Position = [20 20 600 250];
d_num = length(uit.Data);
end
Can I have solution ?
댓글 수: 0
답변 (1개)
Ravi
2023년 10월 5일
Hi JH Bang,
According to my understanding, you want to select files using “uitable” and later want to display them in a table.
The “file_read” function will work fine here. However, for the “AddButtonPushed” method, there is a workaround for concatenating new entries to the table data. I suggest you use the following concatenation method in your “AddButtonPushed” method
newEntry = {true, app.EditField.Value};
uit.Data = [uit.Data; newEntry];
Example:
x = [1 2 3];
y = [4 5 6];
x = [x; y];
disp(x);
Hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File 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!