📄 show.m
字号:
function show(var)% Function displays numeric variables, structures, and cell arrays in a% more general form than provided by Matlab and uses "disp" for all other% variables% % Written by: E. R.: January 22, 2006% Last updated: March 6, 2006: cosmetics%% show(var)% INPUT% var variable to display in the command windowdisp(inputname(1))if all(isnumeric(var)) & ~all(ishandle(var)) show_no1(var)elseif isstruct(var) disp(orderfields(var))elseif iscell(var) var1.var=var; % This fancy footwork is designed to prevent the % name "var" to show up in the list showcell(var1(1).var)else disp(var)end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function []=show_no1(array)% Function displays 1-D array% show_no1(array)% n=length(array);% scale=10^ceil(log10(max(abs(array))));scale=1;%{%if nargin > 1 if scale == 1; fprintf([' (%d values)\n'],n) else fprintf([' %d values; %7.5g multiplied by:\n'],n,scale) end%end%}fprintf('%7.5g %7.5g %7.5g %7.5g %7.5g %7.5g %7.5g %7.5g %7.5g %7.5g\n',array/scale)if rem(length(array),10) ~= 0, fprintf('\n'); end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -