Hi, i'm having an image of size[280,307,191] and i want to get the argmin of it,Any help?

 채택된 답변

James Tursa
James Tursa 2013년 4월 15일
편집: James Tursa 2013년 4월 15일

3 개 추천

[m n] = min(M(:));
[x y z] = ind2sub(size(M),n);
x, y, z will be the indexes (i.e., argmin) of the minimum value of your 3D array M.

댓글 수: 2

Rawan hamdi
Rawan hamdi 2013년 4월 16일
thanks but what are the m & n ?
The documentation of min explains this exhaustively already. Type this in Matlab's command window:
help min
doc min
and read it.

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Cedric
Cedric 2013년 4월 15일

1 개 추천

How do you define argmin? If it is the global min, you can get it as follows:
min(M(:))
where M is your 3D array.

댓글 수: 4

Rawan hamdi
Rawan hamdi 2013년 4월 16일
편집: Rawan hamdi 2013년 4월 16일
i don't know what argmin means actually,
i have an equation like this :
x = arg min |g-u|.^2 g and u are 2 multibanded images
and im trying to implement it in matlab
Jan
Jan 2013년 4월 16일
Why do you want to implement something, when you do not know its mathematical meaning?
Sreeda M A
Sreeda M A 2016년 7월 13일
can you please explain what values should I give for M ??
Andrei Bobrov
Andrei Bobrov 2016년 7월 13일
편집: Andrei Bobrov 2016년 7월 13일
Hi Sreeda M A! Example:
M = randi(400,280,307,191);

댓글을 달려면 로그인하십시오.

Sean de Wolski
Sean de Wolski 2013년 4월 15일

1 개 추천

Or:
min(min(min(M)))

댓글 수: 2

Nope, this will return the minimum value and not the index of the minimum value
Cedric
Cedric 2019년 4월 30일
Just use [~,linIdx] = min(M(:)) and then convert to subscripts using IND2SUB.

댓글을 달려면 로그인하십시오.

Steven Lord
Steven Lord 2019년 4월 30일

0 개 추천

If you're using release R2019a or later, you probably want to call min with the 'all' dimension input and the 'linear' flag.

질문:

2013년 4월 15일

답변:

2019년 4월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by