CheckNumericArraySi​ze( A, dim_sizes )

版本 1.4.0.0 (2.9 KB) 作者: Paulo Abelha
Checks if the input matrix has the desired dimension sizes
88.0 次下载
更新时间 2016/9/21

查看许可证

Use this to check if your input is a numeric array and if it has the desired size in each dimension
Example usages:
CheckNumericArraySize( A, [Inf 2] ) - i.e., no restrictions on dimension 1 and size 2 for dimension 2
CheckNumericArraySize( A, [Inf Inf] ) - for an MxN array
CheckNumericArraySize( A, [3 4 5]) - for a 3x4x5 array
CheckNumericArraySize( A, []) - for an empty array
Note, for instance, that CheckNumericArraySize( A, [Inf Inf] ) will fail if A has more than two dimensions

引用格式

Paulo Abelha (2024). CheckNumericArraySize( A, dim_sizes ) (https://www.mathworks.com/matlabcentral/fileexchange/59168-checknumericarraysize-a-dim_sizes), MATLAB Central File Exchange. 检索时间: .

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

Community Treasure Hunt

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

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

Addressed issues pointed out by Jan Simon

1.3.0.0

Single number now pass the test to make it more akin to Matlab

1.2.0.0

Fixed description
Fixed bug by putting a new requirement that the second param be either an empty or a 1 * d array

1.1.0.0

Fixed comments

1.0.0.0