Rectify matrix sizes

版本 1.0.0.0 (1.8 KB) 作者: Jeff Dunne
Rectify ensures uniform sizes for matrices
733.0 次下载
更新时间 2006/10/16

查看许可证

RECTIFY takes a set of input matrices and produces as output a set of REPMAT'ed matrices such that all matrices have the same dimensions. This is similar to NDGRID is some respects, but the inputs are not just vectors of values to expand (although it can be used that way).

For example,

a = [0 1 2 3 4 5
6 7 8 9 10 11];
b = [11 12
13 14
15 16
17 18];

[A,B] = RECTIFY(a,b);

produces:

A = [0 1 2 3 4 5
6 7 8 9 10 11
0 1 2 3 4 5
6 7 8 9 10 11];

and

B = [11 12 11 12 11 12
13 14 13 14 13 14
15 16 15 16 15 16
17 18 17 18 17 18];

This function is most useful when creating high order matrices of input combinations for vectorized functions.

引用格式

Jeff Dunne (2024). Rectify matrix sizes (https://www.mathworks.com/matlabcentral/fileexchange/12634-rectify-matrix-sizes), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Specialized Power Systems 的更多信息

Community Treasure Hunt

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

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