MATLAB: Method of subtracting a number from a three-dimensional matrix

subtracting 3d

Welcome all and thanks in advance for help.
I have a 3D matrix size (300 x 16 x 21), I want to find a loop to subtract the number 1000 from the first column that has 300 rows

Best Answer

Instead of loop, you can do the following: LEt A be your matrix of size 300x16x21.
A(:,1,:) = A(:,1,:)-1000 ;
Related Question