📄 display.m
字号:
function display(S)
% DISPLAY -- display function for symbolic matrices
%
% S
% display(S)
%
% This function does not need to be called by the user. Just typing
% the name of a symbolic matrix has the same effect.
% This function is invoked automatically by Matlab if the result of a
% calculation is a symbolic matrix.
%
% The reason for including it here is that the usual display function
% built into Matlab is braindamaged: it cannot display symbolic
% matrices of more than two dimensions correctly.
% Copyright (c) 2004 by Fritz Keinert (keinert@iastate.edu),
% Dept. of Mathematics, Iowa State University, Ames, IA 50011.
% This software may be freely used and distributed for non-commercial
% purposes, provided this copyright statement is preserved, and
% appropriate credit for its use is given.
%
% Last update: Feb 20, 2004
n = size(S);
if (length(n) <= 2)
% standard display
if isequal(get(0,'FormatSpacing'),'compact')
disp([inputname(1) ' =']);
disp(S)
else
disp(' ')
disp([inputname(1) ' =']);
disp(' ');
disp(S)
end
return
end
h = n(3:end);
nh = length(h);
hstep = [1,cumprod(h)];
for i = 1:prod(h)
% generate index
ind = index(h,i);
if ~isequal(get(0,'FormatSpacing'),'compact')
disp(' ');
end
subscript = '(:,:';
for j = 1:nh
subscript = [subscript,',',num2str(ind{j})];
end
subscript = [subscript,') ='];
disp([inputname(1),subscript]);
disp(S(:,:,ind{:}))
if ~isequal(get(0,'FormatSpacing'),'compact')
disp(' ');
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -