Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
三维阵列的数学运算&MATLAB_Matlab_Matrix - Fatal编程技术网

三维阵列的数学运算&MATLAB

三维阵列的数学运算&MATLAB,matlab,matrix,Matlab,Matrix,我有一个mx1xn数组(当前m=n=3),我需要从每列中减去一个存储在1xN列中的值 i、 e.n表示时间,从每个时间实例中,我需要从数据中减去一个不同的时间相关常数(1xm或任何维度) 最好的方法是什么?我的尝试无效: data(:,2,:) - constants(:,2,:) %constants in this case is 1x1x3, data is 3x1x3 一种尝试是循环,但我想知道什么是更有效的方法。使用: bsxfun(@minus, data, constants

我有一个mx1xn数组(当前m=n=3),我需要从每列中减去一个存储在1xN列中的值

i、 e.n表示时间,从每个时间实例中,我需要从数据中减去一个不同的时间相关常数(1xm或任何维度)

最好的方法是什么?我的尝试无效:

data(:,2,:) - constants(:,2,:)   %constants in this case is 1x1x3, data is 3x1x3
一种尝试是循环,但我想知道什么是更有效的方法。

使用:

bsxfun(@minus, data, constants)