whats the diffrence in max methods ?

10 Ansichten (letzte 30 Tage)
Vinay Sharma
Vinay Sharma am 12 Mai 2020
Beantwortet: KSSV am 12 Mai 2020
what is diffrence between given 2 code?
a(g)=max(p(i,g));
&
a(g)=max(p(:,g));
both gives diffrent answer why ?

Akzeptierte Antwort

KSSV
KSSV am 12 Mai 2020
a(g)=max(p(i,g));
The above gives maximum in array p(i,g). If p(i,g) is a scalar, the same value you will get.
a(g)=max(p(:,g));
In the above ,: stands for all, as it is present in the rwo, p(:,g) picks the entire gth column in p. And max gives you maximum in the gth column of p.

Weitere Antworten (0)

Kategorien

Mehr zu Parallel Computing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by