how to show specific row in gui table from mat file, that is identity ppl that have a car, i make license plate recognition, i need to show up the specific data in table if my program succesfull read the number plate i try this but cant show
myData = load('dataplat.mat');
% update the uitable
set(handles.uitable1,'Data',myData.myCellArray);

7 commentaires

Jan
Jan le 9 Août 2017
Please explain the occurring problem.
Yusran Said
Yusran Said le 9 Août 2017
i want to show data from mat file to gui table
Geoff Hayes
Geoff Hayes le 9 Août 2017
Yusran - please clarify what you mean by show up the specific data. Are you trying to highlight a certain row?
Jan
Jan le 9 Août 2017
Modifié(e) : Jan le 9 Août 2017
@Yusran Said: Then the code you have posted is fine. Load the data and display the contents of the field myCellArray as Data property of the uitable. I still do not see a problem here. Do you get an error message? Do you want to do something else? I do not know what "but cant show" means.
Yusran Said
Yusran Said le 10 Août 2017
i got error message when push the button, Error using table (line 281) Invalid parameter name: pushbutton1_Callback.
Error in @(hObject,eventdata)table('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Caused by: You may have intended to create a table with one row from one or more variables that are character strings. Consider using cell arrays of strings rather than character arrays. Alternatively, create a cell array with one row, and convert that to a table using CELL2TABLE.
Error while evaluating UIControl Callback
Yusran Said
Yusran Said le 10 Août 2017
Modifié(e) : Yusran Said le 10 Août 2017
specific data mean if my program can read succesfull plate, same with database, table will show the data in table from mat file, u can see my data in the picture, there is number plate, name, department n status, my program is video processing plate recognition, if succesfully read same number plate with database, so i want show 1 row data to gui table
Yusran Said
Yusran Said le 10 Août 2017
that the table must be setting? i change code but get same erorr message,

Connectez-vous pour commenter.

 Réponse acceptée

Walter Roberson
Walter Roberson le 10 Août 2017

0 votes

Do not name your gui "table": you are confusing MATLAB, which thinks table() is for creating table objects https://www.mathworks.com/help/matlab/ref/table.html which are not related to the display tables, uitable()

2 commentaires

Yusran Said
Yusran Said le 10 Août 2017
Modifié(e) : Walter Roberson le 10 Août 2017
oh, ok my fault, thanks for answer, but still erorr
Reference to non-existent field 'myCellArray'.
Error in contoh>pushbutton1_Callback (line 84)
set(handles.uitable1,'Data',myData.myCellArray);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in contoh (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)contoh('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
what should i do?
At the command line command
dbstop if error
and run your program. When it stops with the error, look at
fieldnames(myData)
whos -file dataplat.mat
I suspect your dataplat.mat does not contain a variable named "myCellArray".

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Instrument Control Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by