行列の範囲指定をして​総和を算出する方法を​知りたいです。

63 vues (au cours des 30 derniers jours)
啓史 千葉
啓史 千葉 le 26 Août 2020
Commenté : 源樹 上林 le 26 Août 2020
行列の範囲指定をして総和を算出する方法を知りたいです。
フォルダから横960ピクセル、縦が687ピクセルの画像を読み取り、行列に代入してあります。
この画像に対して、列の方向で総和を求めるためには sum関数 を使って計算を行っています。
例えば sum(A)といった形です。
今回、この列の方向で総和を求めるときに、行列の範囲指定をして計算したいです。
例えば 縦が687のピクセルのうち、200ピクセル目から400ピクセル目のみで総和を取る。といった形です。
そのためにはどの関数を使ってどのように記述すれば良いですか?

Réponse acceptée

源樹 上林
源樹 上林 le 26 Août 2020
多分これで。
sum(A(200:400,:))
  1 commentaire
源樹 上林
源樹 上林 le 26 Août 2020
おすすめの資料
MATLAB入門 5.2 複数の要素の抽出
https://jp.mathworks.com/learn/tutorials/matlab-onramp.html

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur イメージ dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!