📄 a0a1bcd.m
字号:
function msg = a0a1bcd(a0,a1,b,c,d)
%A0A1BCD Checks dimensional consistency of A0,A1,B,C,D matrices.
% MSG = A0A1BCD(A0,A1,B,C,D) checks the consistency of the dimensions
% of A0,A1,B,C,D. Returns the empty matrix if they are, or an
% an error message string if they are not.
msg = [];
[ma0,na0] = size(a0);
if (ma0 ~= na0)
msg = 'The A0 matrix must be square';
end
if [ma0,na0] ~= size(a1)
msg = 'The A0 and A1 matrices must have the same dimensions.';
end
[mb,nb] = size(b);
if (ma0 ~= mb)
msg = 'The A0 and B matrices must have the same number of rows.';
end
[mc,nc] = size(c);
if (nc ~= ma0)
msg = 'The A0 and C matrices must have the same number of columns.';
end
[md,nd] = size(d);
if (md ~= mc)
msg = 'The C and D matrices must have the same number of rows.';
end
if (nd ~= nb)
msg = 'The B and D matrices must have the same number of columns.';
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -