필터 지우기
필터 지우기

How to select numbers?

조회 수: 2 (최근 30일)
Pari
Pari 2019년 7월 17일
답변: Pari 2019년 7월 17일
F=rand(400) M=rand(400) How can i select F<M ?

채택된 답변

Pari
Pari 2019년 7월 17일

Thanks dear friends My problem solved with index :)

추가 답변 (2개)

infinity
infinity 2019년 7월 17일
Hello,
You can simply type
F = rand(3)
M = rand(3)
result = F(F<M)
  댓글 수: 4
Pari
Pari 2019년 7월 17일
My code: F=rand(1,400); M=rand(1,400); Tf=log(-F)/.73; Tm=log(-M)/1.2; I should select Tm<Tf and sum these numbers for A= sum(Tm)/sum(Tf)
infinity
infinity 2019년 7월 17일
Hello,
What do you mean when compare Tm and Tf when each element of them are complex number?
Assume when we obtain element of Tm that smaller than Tf, what do you mean by
"sum these numbers for A= sum(Tm)/sum(Tf)" ?

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


Jan
Jan 2019년 7월 17일
F = rand(1,400);
M = rand(1,400);
Tf = log(-F) / 0.73;
Tm = log(-M) / 1.2;
It is hard to guess, what this means: "I should select Tm<Tf and sum these numbers for A= sum(Tm)/sum(Tf)". Perhaps:
index = (Tm < Tf);
A = sum(Tm(index)) / sum(Tf(index))

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by