www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/RemainderofTwoArraysExample.m

    %% Remainder of Two Arrays  

%% 
% Create two 3-by-3 matrices, then use |rem| to find the remainder after
% dividing |Y| into |X|. 
X = [1 2 3;4 5 6;7 8 9];
Y = [9 8 7;6 5 4;3 2 1];
R = rem(X,Y) 

%%
% Inputs |X| and |Y| must have the same dimensions unless one is a scalar
% double.