I am new to matlab and I want to show my excel data as a table in axes in gui using GUIDE. I am reading the table from the excel sheet and trying to convert it into uitable and display it in axes. How can i do that?
조회 수: 1 (최근 30일)
이전 댓글 표시
function Emergency_selection_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Emergency_selection (see VARARGIN)
% Choose default command line output for Emergency_selection
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
%read the data from file
%[num,txt,raw]=xlsread('C:\Users\abhijit\Desktop\mmajor.xlsx');
%uitable1 =uitable(Emergency_selection,'Data',[num,txt,raw]);
t=readtable('C:\Users\abhijit\Desktop\mmajor.xlsx');
tab=uitable
tab=t;
%update the table
set(handles.tab,'data',num,'ColumnName',txt);
%update the plot
plot3(handles.axes1, num(:,1), num(:,2), num(:,3));
% UIWAIT makes Emergency_selection wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Emergency_selection_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
댓글 수: 1
Geoff Hayes
2018년 5월 28일
Abhijit - since you are using GUIDE, why don't you just create a uitable (there, in GUIDE) and then populate it in your code? Do you know how many colummns of data will be in the table? Do you know their data types?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!