Effacer les filtres
Effacer les filtres

how to store or display some data from excel sheet in uitable created in GUI?

2 vues (au cours des 30 derniers jours)
Anand M S
Anand M S le 11 Juin 2013
*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?

Réponses (1)

Iain
Iain le 11 Juin 2013
[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.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by