?? gcd1.m
字號:
function res = gcd1(a)% DESCRIPTION res = gcd1(a)% Greatest common divisor for each column of any non empty matrix% with integer values. % INPUT% a -- Any non integer matrix.% OUTPUT% res -- A vector with one element for each column,% containing the greatest common divisor for that column.% TRY% gcd1([5; 30]) or gcd1([2*3*4 3*5 2*3]')% SEE ALSO% gcd % by Magnus Almgren 991101if isempty(a) res = a; returnendr = a(1,:); for i = 1:size(a,1); r = gcd(r,a(i,:));endres = reshape(r,size(a(1,:)));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -