Store values from text file into uitable
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
laurie
le 20 Mar 2015
Réponse apportée : Geoff Hayes
le 22 Mar 2015
I created a uitable in GUI and I am trying to get data from a text file to upload into the first column. This is as far as I got.
fid = fopen('file.txt','r'); %open txt file
rawdata = fscanf(fid,'%g',[1 inf]); %store
rawdata=rawdata';
set(handles.uitable1, 'rawdata', Data(:,1)); %store in column 1 of uitable1
Could someone pin point where I'm going wrong?
0 commentaires
Réponse acceptée
Geoff Hayes
le 22 Mar 2015
Laurie - you need to set the Data property of the uitable1 with the data. There is no rawdata property that you can access (and so are probably observing some kind of error). Try the following instead
set(handles.uitable1, 'Data', rawdata);
The syntax for set is to supply the handle, then the property name, and then the data that you wish to update the property with. If rawdata is a single column then presumably only the first column (in the table) will be updated.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Environment and Settings 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!