フィルターのクリア

I want to collect the smallest arrays on the 3rd axis and get a 2d image.

1 回表示 (過去 30 日間)
영훈 정
영훈 정 2023 年 7 月 6 日
コメント済み: 영훈 정 2023 年 7 月 6 日
i have a 3X3X3 double data
a=[1 1 1;10 10 10;10 10 10];
b=[20 20 20;2 2 2;20 20 20];
c=[30 30 30;30 30 30;3 3 3];
d=cat(3,a,b,c);
To illustrate, let's say 3X3X3 is row, column, page.
I want to find the minimum value several pages with fixed rows and columns.
I think repeating this would make one 3X3 matrix in each row and column.
I think it's possible if i use "for loops" to find it. But can't do this using "min()"?
% i want get e=[1 1 1 ;2 2 2; 3 3 3]
e=[1 1 1 ;2 2 2; 3 3 3]
e = 3×3
1 1 1 2 2 2 3 3 3

採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 7 月 6 日
a=[1 1 1;10 10 10;10 10 10];
b=[20 20 20;2 2 2;20 20 20];
c=[30 30 30;30 30 30;3 3 3];
d=cat(3,a,b,c);
out=min(d,[],3)
out = 3×3
1 1 1 2 2 2 3 3 3
  1 件のコメント
영훈 정
영훈 정 2023 年 7 月 6 日
a=[1 1 1;10 10 10;10 10 10];
b=[20 20 20;2 2 2;20 20 20];
c=[30 30 30;30 30 30;3 3 3];
d=cat(3,a,b,c);
out=min(d,[],3)
out = 3×3
1 1 1 2 2 2 3 3 3
out=min(d,3)
out =
out(:,:,1) = 1 1 1 3 3 3 3 3 3 out(:,:,2) = 3 3 3 2 2 2 3 3 3 out(:,:,3) = 3 3 3 3 3 3 3 3 3
%I was stupid

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by