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

    %% Remainder After Division for Negative Divisor  

%% 
% Find the remainder after division by a negative divisor for a set of
% integers including both positive and negative values. Note that nonzero
% results are always negative if the divisor is negative.
a = [-4 -1 7 9];
m = -3;
b = mod(a,m)