5.0

5.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 31.88 KB File ID: #16888
image thumbnail

Visualize sparsity pattern

by Dimitri Shvorob

 

15 Oct 2007 (Updated 16 Oct 2007)

(SPY in style)

| Watch this File

File Information
Description

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

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
16 Oct 2007 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
tf();

us

17 Oct 2007 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..'.

17 Oct 2007 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
};

us

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
specialized Dimitri Shvorob 22 Oct 2008 09:31:39
plotting Dimitri Shvorob 22 Oct 2008 09:31:39
spy Dimitri Shvorob 22 Oct 2008 09:31:39
visualize Dimitri Shvorob 22 Oct 2008 09:31:39
sparsity Dimitri Shvorob 22 Oct 2008 09:31:39
pattern Dimitri Shvorob 22 Oct 2008 09:31:39
graphics Dimitri Shvorob 22 Oct 2008 09:31:39

Contact us at files@mathworks.com