creating GUI for my program by app designer

% enter the two matrices
u= ([1 0.5 0.3 0.2; 2 3 4 5]);
v= ([0.5 0.7 0.2 0.4; 2 3 4 5]);
display('List of fuzzy operations:')
display('1.Union')
display('2.Intersection')
display('3.Complement')
display('4.Difference u|v')
display('5.Difference v|u')
display('6.DeMorgans law')
option=input('Select an operation (1-6): '); % user select which operation
if(option ~= 1 && option ~=2 && option ~=3 && option~=4 && option ~=5 && option ~=6)
display('Enter correct choice ')
end
%Union
if (option==1)
w=max(u,v) %choose the maximum
display(W)
end
%Intersection
if (option==2)
p=min(u,v) %choose the minimum
display(p)
end
%Complement
if (option==3)
option1=input('enter whether to find complement for first matrix or second matrix');
if (option1==1)
[m,n]=size(u);
q=ones(m)-u; %subtract it from u
display(q)
else
q=ones(m)-v; %subtract it from v
display(q)
end
end
%Difference u|v
if (option==4)
[m,n]=size(v);
vcomp=ones(m)-v; %find complement of v
q=min(u,vcomp); %subtract u and v complement
display(q)
end
%Difference v|u
if(option==5)
[m,n]=size(u);
ucomp=ones(m)-u; %find complement of u
r=min(ucomp,v); %subtract v and u complemnt
display(r)
end
%DeMorgans Law
if (option==6)
[m,n]=size(u);
ucomp=ones(m)-u; %find complement of u
[o,p]=size(v);
vcomp=ones(o)-v; %find complement of v
q=min(ucomp,vcomp); %find minimum between u complement and v complement
r=max(ucomp,vcomp); %find maximum between u complement and v complement
display(q)
display(r)
end

Answers (1)

Create a GUI with App Designer, then paste that code into a callback function for a push button.

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Asked:

on 5 Nov 2022

Answered:

on 5 Nov 2022

Community Treasure Hunt

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

Start Hunting!