No BSD License  

Highlights from
spyx.m

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 5.25 KB File ID: #19187
image thumbnail

spyx.m

by Carlos Adrian Vargas Aguilera

 

12 Mar 2008 (Updated 13 Mar 2008)

Same as SPY function but with user defined axes.

| Watch this File

File Information
Description

Syntax:

        spyx(x,y,S)

This programs uses the SPY function, which is used to plot marks on the non zero matrix elements (even on NaN's), but uses the user-specified axes (x,y) instead of rows and columns indexes (check the screenshot where

S = [
5.6 9.9 1.8 9.1 8.9 0 0 7.5 6.9 0
8.5 5.4 3.6 1.0 0.7 0 0 0 0 0
3.5 7.1 0 7.5 0 0 0.8 0 4.0 8.9
4.5 NaN NaN 7.4 0.5 3.3 7.8 0 0.6 0
0.5 NaN NaN 0 0 0 0 0 7.8 0
1.8 0 1.8 0 0 0.6 0 5.3 3.4 0
6.6 0 2.1 6.0 0 3.0 1.1 7.3 6.1 0
3.3 7.6 9.1 0 NaN 0 NaN 0 7.4 0.9
  0 8.2 6.8 1.3 0 5.1 0 7.8 0 0
1.2 1.0 4.7 0 0 0 0 2.9 0 NaN
];

Acknowledgements
This submission has inspired the following:
imagescnan.m v2.1 (Aug 2009)
MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
14 Mar 2008 Dimitri Shvorob

Sorry, but I don't quite get the point. The axes in SPY really have to be the way they are, to show row number and column number; what is the use of a different axis scaling?

Your example somewhat complicates matters with the extra mark-NaN-elements functionality.

Let me point you to this file:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=16888&objectType=FILE

18 Mar 2008 Carlos Adrian Vargas Aguilera

Hi Dimitri:
  
Yes, MATLAB's SPY or yours are used to get the sparsity of a matrix X(i,j), but mine is to get the sparsity of a surface z(x,y), i.e., the axes have a PHYSICAL MEANING, but what is most important, one can look the sparsity OVER a held surface (like in the example), which CANNOT be done with the others SPYs functions.
  
Besides, my example in fact are two: one to look for zeros and the other to look for NaN's; so, simple versatility.

Cheers!

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data exploration Carlos Adrian Vargas Aguilera 22 Oct 2008 09:53:13
spy Carlos Adrian Vargas Aguilera 22 Oct 2008 09:53:13
sparse Carlos Adrian Vargas Aguilera 22 Oct 2008 09:53:13
function Carlos Adrian Vargas Aguilera 22 Oct 2008 09:53:13
graphical Carlos Adrian Vargas Aguilera 22 Oct 2008 09:53:13
data Carlos Adrian Vargas Aguilera 22 Oct 2008 09:53:13
exploration Carlos Adrian Vargas Aguilera 22 Oct 2008 09:53:13
interaction Carlos Adrian Vargas Aguilera 22 Oct 2008 09:53:13

Contact us at files@mathworks.com