calculate the minimum probability
조회 수: 2 (최근 30일)
이전 댓글 표시
I have in one case two matrices and in the other case three matrices of size 2922x1. the values within the matrices are probability values. how do i calculate the minimum probability between these 2 and between these 3 matrices?
댓글 수: 2
채택된 답변
Jon
2022년 1월 19일
Say you have three matrices of the same size A,B,C then you can find the minimum as you describe using
D = min(min(A,B),C)
댓글 수: 0
추가 답변 (1개)
Steven Lord
2022년 1월 19일
Assuming they are the same class and size, you can concatenate them and call min with a dimension input.
A = randi([-5, 5], 4)
B = randi([-5, 5], 4)
C = cat(3, A, B)
D1 = min(C, [], 3) % Min along the third dimension
The concatenation strategy can work with more than two arrays, but for this simple example of two arrays you can just call the binary form of min.
D2 = min(A, B)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!