フィルターのクリア

Finding the column of a matrix with the largest value

1 回表示 (過去 30 日間)
Kevin Akash Rajasekaran
Kevin Akash Rajasekaran 2021 年 7 月 13 日
Hey all! I have a 65X64 cell called 'spikes" with a range of numbers in it. What might be the best way to go about selecting the column (say for the first row only) with the largest element in it. I'm more interested in which column has the largest element rather than the element value itself. I've also attached a .mat file of the cell in question. Thanks in advance!

採用された回答

Simon Chan
Simon Chan 2021 年 7 月 13 日
Try this,
A = load('spikes.mat');
B = cell2mat(A.spikes);
[~,I] = max(max(B))
  1 件のコメント
Kevin Akash Rajasekaran
Kevin Akash Rajasekaran 2021 年 7 月 13 日
Works like a charm. Thanks bunches!

サインインしてコメントする。

その他の回答 (1 件)

KSSV
KSSV 2021 年 7 月 13 日
Read about the function max. Here you can specify the dimension in which you want a maximum value. Also max gives you the value and index of the element.

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by