whats the diffrence in max methods ?

16 ビュー (過去 30 日間)
Vinay Sharma
Vinay Sharma 2020 年 5 月 12 日
回答済み: KSSV 2020 年 5 月 12 日
what is diffrence between given 2 code?
a(g)=max(p(i,g));
&
a(g)=max(p(:,g));
both gives diffrent answer why ?

採用された回答

KSSV
KSSV 2020 年 5 月 12 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel Computing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by