资源简介
matlab开发-spy2m。有了这个,你可以更容易地确定矩阵的元素位置。
代码片段和文件信息
function spy2(Acol)
%SPY2 An improvement of SPY
% SPY2(A) where A is a matrix will plot
% the matrix with color codes.
% Elements containing NaN or Inf will be counted as
% non-zero but will be displayed
% as zero elements.
%
% SPY2(ACOLOR) will plot zero elements with
% white color and nonzero elements with black
% color.
% Elements containing NaN or Inf will be counted as
% non-zero and will also be displayed
% as non-zero elements.
%
% The displayed matrix will have sides proportional to
% the number of elements in each row/column.
% If the matrix contains complex numbers only the real
% part will be displayed.
%
% See also SPY.
% Copyright 2000-11-14 B. Rasmus Anthin.
% Revision 2003-09-15 2003-09-16.
error(nargchk(12nargin))
A=real(double(A));
A(~isfinite(A))=realmin;
A(end+1end+1)=0;
x=1:size(A2);
y=1:size(A1);
[XY]=meshgrid(x-.5y-.5); %i use surf and meshgrid instead of pcolor so that
if nargin==1
surf(XYA) % the element numbers will be correctly aligned
colormap gray %just change this afterwards to get another colormap
colorbar
else
A=~~A;
A(1:endend)=0;
A(end1:end)=0;
surf(XYA)
if ischar(col)
switch(lower(col))
case {‘y‘‘yellow‘}
col=[1 1 0];
case {‘m‘‘magenta‘}
col=[1 0 1];
case {‘c‘‘cyan‘}
col=[0 1 1];
case {‘r‘‘red‘}
col=[1 0 0];
case {‘g‘‘green‘}
col=[0 1 0];
case {‘b‘‘blue‘}
col=[0 0 1];
case {‘w‘‘white‘} %very bad idea :-)
col=[1 1 1];
case {‘k‘‘black‘}
col=[0 0 0];
otherwise
col=[0 0 1]; %default to blue color
end
end
if isempty(col) col=[0 0 1];end
colormap([1 1 1;col])
end
view(2)
axis ij equal tight
box on
xlabel([‘nz = ‘ int2str(nnz(A))])
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1946 2018-07-11 20:21 spy2.m
相关资源
- matlab开发-DynaSimDynaSim
- matlab开发-landmask
- matlab开发-经济调度通用算法解决方案
- matlab开发-图片加密和解密
- matlab开发-分子通讯粘着剂
- matlab开发-IEEE754二进制表示
- matlab开发-kmvcreditriskmodel违约风险概率
- matlab开发-17电平模块多电平转换器
- matlab开发-Xfoilformatlab
- matlab开发-脑瘤的分割
- matlab开发-车辆网络工具箱支持kvaser和
- matlab开发-CryoSat2DEMs
- matlab开发-BlandAltmanplot
- matlab开发-使用PSO的最佳模糊控制器
- matlab开发-电机磁轴承
- matlab开发-Treynorblackportfoliomanagement模型
- matlab开发-黑白图像增强器
- matlab开发-二维波动方程模拟
- matlab开发-ResponseSpectra
- matlab开发-huashiyiqikeLSTMMATLAB
- matlab开发-HestonOptionPricer
- matlab开发-三相电压调节器
- matlab开发-单级电液伺服阀
-
matlab开发-iau2006 acioba
sedDusingXy系列 - matlab开发-带DPWM0调制的三相逆变器
- matlab开发-Earthquakesimulation
- matlab开发-带MPPT的住宅网格连接PVSys
- matlab开发-pplot
评论
共有 条评论