當條件式成立時,MATLAB 將執行運算式一,否則,就執行運算式二。 ... y = [0 3 4 1 6]; for i = 1:length(y) if rem(y(i), 2)==0 fprintf('y(%g) = %g is even.
確定! 回上一頁