Method of subtracting a number from a three-dimensional matrix

19 ビュー (過去 30 日間)
nada
nada 2020 年 6 月 4 日
コメント済み: KSSV 2020 年 6 月 4 日
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

採用された回答

KSSV
KSSV 2020 年 6 月 4 日
編集済み: KSSV 2020 年 6 月 4 日
Instead of loop, you can do the following: LEt A be your matrix of size 300x16x21.
A(:,1,:) = A(:,1,:)-1000 ;
  2 件のコメント
nada
nada 2020 年 6 月 4 日
thank you KSSV
I mean, it works like this example
A( 300x16x21) - 1000= (1-1000 , : , : )
(2-1000, : , : )
*
*
*
(300-1000, : , : )
A(new) = A(300 , 16 ,21 )
KSSV
KSSV 2020 年 6 月 4 日
Anew = A(:,1,:)-1000 ;

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by