?? fysalida.m
字號:
%
%------------------------------fysalida.m-----------------------------
% swap matrix's rows, because we sort column (col) by ascending order
%
% input: A = matrix
% col = column we want to sort
% output:A = sorted matrix
%
% N.Cheilakos,2006
%----------------------------------------------------------------------
function A = fysalida(A,col)
[r c] = size(A);
%******************Error checking****************************************
if col < 1 | col > c | fix(col) ~= col
uiwait(msgbox([' error input value second argumment takes only integer values between 1 & ' num2str(c)],'ERROR','error'));
error;
end
%**************************************************************************
for i = 1 : r - 1
d = r + 1 - i;
for j = 1 : d - 1
if A(j,col) > A(j + 1,col)
% row swap j <--> j + 1
A([j j + 1],:) = A([j + 1 j],:);
end
end
end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -