UIMAGE - UIMAGESC

版本 1.1.0.0 (3.4 KB) 作者: Frederic Moisy
Display image with non-linearly spaced axis.
4.9K 次下载
更新时间 2012/1/30

查看许可证

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

引用格式

Frederic Moisy (2025). UIMAGE - UIMAGESC (https://www.mathworks.com/matlabcentral/fileexchange/11368-uimage-uimagesc), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2006a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Bug fixed when both X and Y axis are not linearly spaced (thank you Janti and Tim!!)

1.0.0.0

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