how to store or display some data from excel sheet in uitable created in GUI?
조회 수: 2 (최근 30일)
이전 댓글 표시
*I am unable to dump the contents of excel sheet into the uitable created in GUI.*I am using data from excel sheetes to write matlab programs. Also I have crating a GUI containing all the program codes. But i want to display the data in a uitable from the excel sheets and I am unable to do it. I have wriiten the following code
f = figure('Position', [200 200 400 150]);
dat= rand([10,3]);
cnames = {'Actual', 'Forecast', 'Error' };
rnames={'1','2','3','4','5','6','7','8','9','10'}
t = uitable('Parent',f,'Data',dat,'ColumnName',cnames,'RowName',rnames,'Position',[20 20 360 100]);
From the above code table is created in a new figure with specified rows and columns. But the entries contains some redundant data and i havent provided any path to excel. i want to eliminate those redundant and provide a path to excel sheet so that the specified part of the cell come and fall into the uitable. How can I do this?
댓글 수: 0
답변 (1개)
Iain
2013년 6월 11일
[n,t, r] = xlsread(filename,sheet, range...);
substitute "r" for dat, uigetfile can be used to get the path and the filename of a file, the sheet can be specified, or left to user selectable, just look at the help for xlsread.
댓글 수: 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!