conform_dims(dims,x​,ndim)

版本 1.0.0.0 (942 字节) 作者: Yuxin Jiang
Repmat a vector/matrix so that it conforms to the shape of the given dimension sizes.
41.0 次下载
更新时间 2017/6/10

查看许可证

Repmat a vector/matrix so that it conforms to the shape of the given dimension sizes.
Similar with conform_dims in NCL http://www.ncl.ucar.edu/Document/Functions/Built-in/conform_dims.shtml
Usage:
output = conform_dims(dims,x,ndim)
dims: An array of dimension sizes of which x will be conformed to.
x: a vector/matrix whose dimensions must be a subset of dims.
ndim: An array of dimension indexes to indicate which dimension sizes
indicated by dims match the dimensions in x. The leftmost dimension index is 1.

Example:
h2d = rand(2,3);
h3d = rand(2,3,4);
y = [1;2;3];
y2d = conform_dims(size(h2d),y,2)
y3d = conform_dims(size(h3d),y,2)
y3d = conform_dims(size(h3d),y2d,[1 2])

引用格式

Yuxin Jiang (2024). conform_dims(dims,x,ndim) (https://www.mathworks.com/matlabcentral/fileexchange/63295-conform_dims-dims-x-ndim), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2007a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Large Files and Big Data 的更多信息

Community Treasure Hunt

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

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