필터 지우기
필터 지우기

how to select non-zero filled column(s) in matlab

조회 수: 1 (최근 30일)
Andras Gergely
Andras Gergely 2019년 7월 23일
답변: Andras Gergely 2019년 7월 23일
Hi,
I would need to select non-zero filled column from arrays when series of instruction would proceed.
Just an example:
pwm1=log10(pw65(pWM_range))/log10(pw1(pWM_range)); (attached underneath)
pwr1=mean(pwm1(:,1));
and tha last one is the 1st column filled with non-zero numbers but there are plenty of these instrucction should be calculcated and always changing. So, there is no way to select it all the time.
Could you help with an answer?
Many thanks for the help in advance.
Kind regards.
Bandi
0.997700493582516 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.974649482475760 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.976383851005291 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.983604299096846 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.885228173640926 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.647149490813294 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.527607374558469 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.466654449446246 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.432091745484335 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.412744391480086 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.405327410558207 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.408704326744636 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.423647246939157 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.452405499942985 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.501664174171490 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.579243076900571 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 7월 23일
any(pwr1) is true for columns that contain at least one nonzero

댓글을 달려면 로그인하십시오.

채택된 답변

Andras Gergely
Andras Gergely 2019년 7월 23일
Dear Roberson,
Yes, it really works fine.
So, many thanks for that.
Cheers!
Kind regards.
Bandi

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by