remove zeros from a 15x300 matrix and find the median
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Rik
2020년 2월 11일
You can use this inside your loop.
AS_V(i)= median(AS(AS~=0));
댓글 수: 3
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 Exchange에서 Whos에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!