How to find index of cell array

2 ビュー (過去 30 日間)
Vishal Sharma
Vishal Sharma 2017 年 1 月 24 日
回答済み: Takuji Fukumoto 2017 年 1 月 25 日
I have a cell array of
A = [2] [4] [5] [7]
[3] [10] [1] [9]
its index is given by code
[maxval idx] = max([imp{:}])
Above code is giving
maxval = 10
index = 4
whereas I want result as index = 6 (row wise calculation)
Please help
  3 件のコメント
the cyclist
the cyclist 2017 年 1 月 24 日
Vishal, perhaps more to the point is that you are asking many extremely basic questions, but not understanding the "big picture" of how the answers relate to each other.
You will be better off learning the fundamentals of MATLAB. There are many free resources for that. For example, you could start here.
If you do not learn the fundamentals, you will forever be reliant on this forum for every tiny question.



Takuji Fukumoto
Takuji Fukumoto 2017 年 1 月 25 日
How about using transposition?
[maxval idx] = max([B{:}])
You can get
maxval =
idx =

その他の回答 (0 件)


Community Treasure Hunt

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

Start Hunting!

Translated by