MATLAB Answers

How to select numbers?

4 views (last 30 days)
Pari
Pari on 17 Jul 2019
Answered: Pari on 17 Jul 2019
F=rand(400) M=rand(400) How can i select F<M ?

  0 Comments

Sign in to comment.

Accepted Answer

Pari
Pari on 17 Jul 2019

Thanks dear friends My problem solved with index :)

  0 Comments

Sign in to comment.

More Answers (2)

infinity
infinity on 17 Jul 2019
Hello,
You can simply type
F = rand(3)
M = rand(3)
result = F(F<M)

  4 Comments

Show 1 older comment
infinity
infinity on 17 Jul 2019
Hello,
To solve your actual problem, you should provide more description of it.
Pari
Pari on 17 Jul 2019
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 on 17 Jul 2019
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)" ?

Sign in to comment.


Jan
Jan on 17 Jul 2019
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))

  0 Comments

Sign in to comment.

Sign in to answer this question.