Inserting a double to a cell

9 ビュー (過去 30 日間)
Cem Eren Aslan
Cem Eren Aslan 2023 年 6 月 2 日
回答済み: James Tursa 2023 年 6 月 2 日
Hi all,
I try to find minimum value in two different colums and then i want to assign the smallest one to a cell. How can i search this minimum value in two different column? How can i insert a double to cell?
Thx.

採用された回答

James Tursa
James Tursa 2023 年 6 月 2 日
E.g.,
x = randi(100,10,10) % sample data
x = 10×10
73 86 10 23 73 93 4 48 1 1 98 98 17 23 23 39 87 51 36 84 80 15 48 46 60 68 7 43 10 32 42 39 64 90 75 27 32 27 3 92 98 67 75 8 55 85 88 34 45 61 6 37 32 55 94 86 100 60 17 6 71 95 89 78 88 96 42 19 3 76 28 93 32 92 19 9 2 23 62 91 87 48 17 72 41 42 29 65 47 36 49 33 36 61 13 56 67 23 21 10
columns = [4,7]; % columns to check
minx = min(x(:,columns)) % minimum of the two columns
minx = 1×2
8 2
c{1} = min(minx) % assign smallest one to cell element
c = 1×1 cell array
{[2]}

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by