'GUIDE' table from imported values
이전 댓글 표시
Hello all,
Hoping you can help, ive been going round in circles the last few days trying to get this very basic guide application to work.
The push button runs a .m file. this then breaks the file up into 4 column vectors each with 10 entires , A, B, C and D.
How do i get these vectors to appear up when i press the push button to initial the script.
Ive tried going through the tutourials, just cant seem to make it work. currently using 2019a
Thanks in advance!
Joe

댓글 수: 3
Geoff Hayes
2019년 8월 14일
Joe - please clarify what you mean by The push button runs a .m file. this then breaks the file up into 4 column vectors each with 10 entires , A, B, C and D. Does the push button callback call a script or function (this is important) that then imports data from a file which it then puts into a 10x4 matrix? Are you then hoping that this 10x4 matrix be used to populate the table? Are A, B, C, and D variables?
Ideally, the m file would be a function that returns a 10x4 matrix that could then be used to populate the GUI table.
Joe Gee
2019년 8월 15일
Geoff Hayes
2019년 8월 15일
Joe - I think that you will want to convert your script (myscript.m) into a function so that it returns a 4x10 matrix (not a table - no need to convert using array2table) that your callback function will then use to populate the table. Something like
function myPushbutton_Callback(hObject, eventdata, handles)
% call your function to get the data
myData = myFunction();
% populate the table
set(handles.uitable1, 'Data', myData);
Note that you may need to massage the myData so that it is a cell array (I can't remember off the top of my head).
Your function will look something like
function [data] = myFunction
data = [];
% read the data from file
data = [A B C D];
or something similar to the above.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Type Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!