4.75

4.8 | 4 ratings Rate this file 93 downloads (last 30 days) File Size: 2.34 KB File ID: #11368

UIMAGE - UIMAGESC

by Frederic Moisy

 

12 Jun 2006 (Updated 05 Sep 2006)

No BSD License  

Display image with uneven axis.

Download Now | Watch this File

File Information
Description

UIMAGE(X,Y,C) displays matrix C as an image, using the vectors X and Y to specify the X and Y coordinates. X and Y may be unevenly spaced vectors, but must be increasing. The size of C must be LENGTH(Y)*LENGTH(X). (Most probably you'll want to display C' instead of C).
 
Contrary to Matlab's original IMAGE function, here the vectors X and Y do not need to be linearly spaced. Whereas Matlab's IMAGE function linearly interpolates the X-axis between X(1) and X(end), ignoring all other values (idem for Y), here UIMAGE allows for X and/or Y to be unevenly spaced vectors, by locally stretching the matrix C (ie, by duplicating some elements of C) for larger X and/or Y intervals.

Use UIMAGESC to scale the data using the full colormap. The syntax for UIMAGESC(X,Y,C,...) is the same as IMAGESC(X,Y,C,...).
 
Typical uses:
- Plotting a spatio-temporal diagram (T,X), with unevenly spaced time intervals for T (eg, when some values are missing, or when using a non-constant sampling rate).
- Plotting a set of power spectra with frequency in log-scale.

Example:
 c = randn(50,20); % Random 50x20 matrix
 x = logspace(1,3,50); % log-spaced X-axis, between 10 and 1000
 y = linspace(3,8,20); % lin-spaced Y-axis, between 3 and 8
 uimagesc(x,y,c'); % displays the matrix

MATLAB release MATLAB 7.2 (R2006a)
Zip File Content  
Other Files uimagesc.m,
uimage.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
13 Jun 2006 RALIHALIZARA Julliard

BEautifull idea!

09 Mar 2008 Sven Holcombe

Excellent work. Piggybacks neatly on core matlab image() and imagesc() functions so I can simply replace these calls. If my input is in fact perfectly linear, then these calls are used directly without further processing. Thank you.

28 Mar 2008 Dhanya parameshwaran

Thanks Frederic. Clever trick , works perfectly!

24 Aug 2009 Gabriel Akira Schreiber

Oh soo cool! Just what I needed.Very nicely done.

Please login to add a comment or rating.
Updates
13 Jun 2006

help text improved

05 Sep 2006

submissions UIMAGE and UIMAGESC
are now merged into a single zip
file.

Tag Activity for this File
Tag Applied By Date/Time
specialized Frederic Moisy 22 Oct 2008 08:29:29
plotting Frederic Moisy 22 Oct 2008 08:29:29
uimagesc image uneven non linear axis Frederic Moisy 22 Oct 2008 08:29:29
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com