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 SolutionsMATLAB: Because when I cut a stereo audio, this happens to be mono x2 = x(1:1000,:); %stereo MATLAB: Iterating a loop many times I would use a for loop because (1) it seems you need to do 1000 iterations and (2) the comparison operation (whatever it is that ‘fun’ does) doesn’t affect the number of iterations. Related QuestionHow to calculate horizontal and vertical correlation of an image in matlab??Storing output of for loop
Best Answer