if male(m,7)==0||male(m,7)==1
if female(f,7)==0||female(f,7)==1
Wfst = 1;
end
if female(f,7)==2||female(f,7)==3||female(f,7)==4
Wfst = 1/2;
end
if female(f,7) == -1
Wfst = 1/2;
end
end
if male(m,7)==2||male(m,7)==3||male(m,7)==4
if female(f,7)==0||female(f,7)==1
Wfst = 0;
end
if female(f,7)==2||female(f,7)==3||female(f,7)==4
Wfst = 1;
end
if female(f,7) == -1
Wfst = 1/2;
end
end
任何人都可以提出處理有條件分配較短方法。我發佈了我正在處理的實際代碼。Matlab的有條件分配
[在Matlab有條件分配]的可能的修訂(http://stackoverflow.com/questions/14498363/conditional-assignment-in-matlab)。刪除你的一個問題。 –