?? table.m
字號:
function sys=mdlOutputs(t,x,u) % u(1)為磁鏈開關信號 u(2)轉矩開關信號 u(3)為磁鏈區域信號
if(u(2)==0) % 如果轉矩開關信號為0,則輸出電壓開關信號(0, 0, 0)
sys(1)=0;
sys(2)=0;
sys(3)=0;
else % 如果轉矩開關信號為1
if(u(1)==1) % 如果磁鏈開關信號為1
switch u(3)
case 1 % 如果磁鏈在區域1
sys(1)=1;
sys(2)=1;
sys(3)=0;
case 2 % 如果磁鏈在區域2
sys(1)=0;
sys(2)=1;
sys(3)=0;
case 3 % 如果磁鏈在區域3
sys(1)=0;
sys(2)=1;
sys(3)=1;
case 4 % 如果磁鏈在區域4
sys(1)=0;
sys(2)=0;
sys(3)=1;
case 5 % 如果磁鏈在區域5
sys(1)=1;
sys(2)=0;
sys(3)=1;
case 6 % 如果磁鏈在區域6
sys(1)=1;
sys(2)=0;
sys(3)=0;
otherwise
error(['SS!=1 2 3 4 5 6']); % 如果磁鏈不在區域1-6則發生錯誤,終止程序
end
else % u(1)==0
switch u(3)
case 1 % 如果磁鏈在區域1
sys(1)=0;
sys(2)=1;
sys(3)=0;
case 2 % 如果磁鏈在區域2
sys(1)=0;
sys(2)=1;
sys(3)=1;
case 3 % 如果磁鏈在區域3
sys(1)=0;
sys(2)=0;
sys(3)=1;
case 4 % 如果磁鏈在區域4
sys(1)=1;
sys(2)=0;
sys(3)=1;
case 5 % 如果磁鏈在區域5
sys(1)=1;
sys(2)=0;
sys(3)=0;
case 6 % 如果磁鏈在區域6
sys(1)=1;
sys(2)=1;
sys(3)=0;
otherwise
error(['SS!=1 2 3 4 5 6']); % 如果磁鏈不在區域1-6則發生錯誤,終止程序
end
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -