Undefined variable "handles"

조회 수: 9 (최근 30일)
Daniele Morello
Daniele Morello 2015년 9월 8일
댓글: Daniele Morello 2015년 9월 8일
hi everyone this is my code:
function getMeasurement_Callback(hObject, eventdata, handles)
filename = handles.filename;
num_row = get(handles.getMeasurement,'String');
range = set_range(num_row) %it's a function that gives me the specified range in the spreadsheet
row = xlsread(filename, range)
my_rows = set_row(row)
function my_rows = set_rows(row)
set(handles.editPREM, 'String', row(2));
set(handles.editTINJ, 'String', row(3));
set(handles.editPREUTH, 'String', row(4));
set(handles.editCVCP, 'String', row(5));
set(handles.editCVCP2, 'String', row(6));
it gives me this error: Undefined variable "handles" or class "handles.editPREM".
Error in provaGUI>set_rows (line 328) set(handles.editPREM, 'String', row(2)); how can i solve?

채택된 답변

Thorsten
Thorsten 2015년 9월 8일
편집: Thorsten 2015년 9월 8일
The variable 'handles' is not known inside your function set_row. You have to define set_rows with an additional parameter 'handles'
function my_rows = set_rows(row, handles)
and call it accordingly
my_rows = set_row(row, handles)
  댓글 수: 1
Daniele Morello
Daniele Morello 2015년 9월 8일
ohh thank u so much, it works now :D

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by