MATLAB equivalent for Python code for argmax from array of user defined objects

Hi, I have an array as shown here. here Bandit is a class I created.
bandits = [Bandit(m1),Bandit(m2),Bandit(m3)];
Now, I want to do the following. Following is a python code which immediately gives me the maxarg of the value of mean from each of these objects.
j = np.argmax([b.mean for b in bandits])
How can I do the same in MATLAB? Kindly help.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

태그

질문:

2018년 4월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by