フィルターのクリア

What is the meaning of "There is no property on the UIControl class."?

3 ビュー (過去 30 日間)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017 年 11 月 21 日
コメント済み: Walter Roberson 2019 年 12 月 26 日
Dear All, I have sets of data and I need to import them to the function based on the month variable, I wrote this code on the gui to code the popupmenu1 I have, but still doesnt work and gives errors, any ideas please ? I have two cases, one is January and the 2nd is July.
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
directory=dir('*.Y07');
count=0;
for K = 1 : length(directory)
filename = directory(K).name;
fileID = fopen(filename,'r');
formatSpec = '%s';
A_cell = textscan(fileID,formatSpec);
A=char(A_cell{1,1}{:,:});
A(find(isnan(A)))=0;
[rows,columns]=size(A);
if columns~=105
ArrayTemp=zeros(rows,105);
ArrayTemp(1:rows,1:columns)=A;
A=ArrayTemp;
A=char(A);
A(isspace(A)) = '0';
end
x1=filename;
xtr=strcat('C:\Users\maa285\Desktop\New folder (2)\',x1);
fid = fopen( xtr, 'wt' );
Month_of_Data = A(:,14:15);
Vehicle_Class = A(:,20:21);
Ans_7=str2num(Month_of_Data);
Ans_10=str2num(Vehicle_Class);
VehClass = Ans_10;
Class9_data = all(VehClass == 9, :);
count=count+1;
state=get(handles.popupmenu1,'value');
month(K)=unique(str2num(Month_of_Data));
switch state
case 1
% month(K)=unique(str2num(Month_of_Data));
set(handles.push1,'Class9_data',Class9_data(Ans_7 == 1, :));
case 2
% month(K)=unique(str2num(Month_of_Data));
set(handles.push1,'Class9_data',Class9_data(Ans_7 == 7, :));
end
end
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 12 月 22 日
Please post an exact copy of the error message.
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017 年 12 月 22 日
Dear Mr Walter, I solved this question and it was my mistake by not defining the proper tags for the controllers. Thank you man

サインインしてコメントする。

回答 (2 件)

Inam khan
Inam khan 2019 年 12 月 25 日
Hello
Somebody can help by solving this error
2019-12-25_190404.png

Inam khan
Inam khan 2019 年 12 月 25 日
function PB2ON_Callback(hObject, eventdata, handles)
% hObject handle to PB2ON (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global x;
writeDigitalPin (x, 'D5', 1);
set(handles.PB2ON, 'variable', 'off');
set(handles.PB2OFF, 'variable', 'on');
% --- Executes on button press in PB2OFF.
function PB2OFF_Callback(hObject, eventdata, handles)
% hObject handle to PB2OFF (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global x;
writeDigitalPin (x, 'D5', 0);
set(handles.PB2ON, 'variable', 'on');
set(handles.PB2OFF, 'variable', 'off');
  2 件のコメント
Inam khan
Inam khan 2019 年 12 月 25 日
Please help......
Walter Roberson
Walter Roberson 2019 年 12 月 26 日
What is class(handles.PB2ON) and class(handles.PB2OFF) ?
I do not recall ever having encountered a Mathworks object class that had a property named variable
I wonder if you wanted to use 'visible' instead of 'variable', or if you wanted to use 'enable' instead of 'variable' ?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by