?? listopt.m
字號(hào):
function f=listopt(x,y,z)
%form f=listopt(x,y,z)
%the z:
%union——交集
%Intersection——并集
%Complement——差集
switch z
case 'union'
k=length(x)+1;b=x;
for i=1:length(y)
for j=1:length(x)
if y(i)==x(j)
break;
else
b(k)=y(i);
end
end
end
f=sort(b)
case 'intersection'
k=1;b=[];
for i=1:length(y)
for j=1:length(x)
if y(i)==x(j)
break;
end
end
if j<=length(x)
b(k)=y(i);
k=k+1;
end
end
f=sort(b)
case 'complement'
k=1;b=[];
for i=1:length(x)
for j=1:length(y)
if x(i)==y(j)
break;
end
end
if j+1>length(x)
b(k)=x(i);
k=k+1
end
end
f=sort(b);
otherwise
fprintf('There''s no ''%s'' in this functon!\n',z)
end
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -