フィルターのクリア

remove zeros from a 15x300 matrix and find the median

1 回表示 (過去 30 日間)
fadams18
fadams18 2020 年 2 月 11 日
コメント済み: Image Analyst 2020 年 2 月 11 日
when I run the code below I get 15x301 matrix AS_V with some receding zeroes
for i=1:15
load(['output/NeNMF_V_', int2str(i), '.mat'], 'AS' );
AS_V(i,:)= AS;
end
I would like to remove these zeros and take take the median of each row so that, I will now have 15x1 matrix

回答 (1 件)

Rik
Rik 2020 年 2 月 11 日
You can use this inside your loop.
AS_V(i)= median(AS(AS~=0));
  3 件のコメント
Rik
Rik 2020 年 2 月 11 日
Can you confirm find(isnan(AS)) returns an empty array?
Image Analyst
Image Analyst 2020 年 2 月 11 日
Attach the mat file where that happens with the paper clip icon if you still have trouble.

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

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by