File Exchange

image thumbnail

Visualize sparsity pattern

version 1.0 (31.9 KB) by

(SPY in style)



View License

Please see SPYDEMO, by following link 'Published m-files' below.

Comments and Ratings (3)

Urs (us) Schwarz

altogether a very nice, professional demo script showing various ways to visualize a sparse matrix including some nice tricks for the newcomer on how to create spiffy figures and a prototypical macro for a quick axis setup.
unfortunately, the author HAS to use a construct that includes a call to EVAL, which is solely due to the fact that TMW (after MANY years of asking for) has not yet had the time to implement the SET(handle,...) command with a return argument in all cases... otherwise, the community could finally use a function handle of this kind:

fh=@(varargin) {
set(gca,'xtick',varargin{1}) % NOT POSSIBLE!
xlabel(varargin{2}) % OK
title(varargin{3}) % OK


Dimitri Shvorob

Thank you for suggestion, Urs! I settled for 'eval' because I couldn't see how to also inlne the label assignments and 'set(gcf..'.

Urs (us) Schwarz

just a thought:

the eval(touchup) is a bit cumbersome (especially in view of your well documented ML skills...); why not use a construct like this

% only two prop/val are shown
% for brevity...
tf=@() set(gca,'xtick',1:k,'xlim',xlim);
% and use it





MATLAB Release
MATLAB 7.2 (R2006a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video