find the minimum value

i have a matrix A with double class type data. i have to find the minimum value of matrix, the problem is the min function on matlab require integer data. is there matlab function to find minimum value on double class type data or function conversion between double to integer so min function can use ?

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 10 日
編集済み: Azzi Abdelmalek 2013 年 2 月 10 日

0 投票

A=magic(5) % Example
out=min(A(:))
% No, min function don't allow just inetger
help min

7 件のコメント

Internazionale
Internazionale 2013 年 2 月 10 日
編集済み: Azzi Abdelmalek 2013 年 2 月 10 日
%blok c
c = mat2cell(Temp, [16 16 16 16 16 16 16 16 16 16 16 16] , ...
[16 16 16 16 16 16 16 16 16 16 16 16]);
%blok e
e = mat2cell(Y, [8 8 8 8 8 8 8 8] , [8 8 8 8 8 8 8 8]);
%scalling blok c --> d
for cc=1:12
for dd=1:12
d{cc,dd}=rata(c{cc,dd});
end
end
% block d and e process
for yy=1:12
for zz=1:12
for aa=1:8
for bb=1:8
min{yy,zz,aa,bb}=d{yy,zz}-e{aa,bb};
rms{yy,zz,aa,bb}=
(sqrt(sum(sum((min{yy,zz,aa,bb})^2))))/64;
mintemp(yy,zz,aa,bb)=rms{yy,zz,aa,bb};
end
end
end
end
% find the minimum value
out=min(mintemp(:));
this is my program, when i try your advice, there's error : ??? Subscript indices must either be real positive integers or logicals.
Error in ==> secret12 at 102 out=min(mintemp(:));
Matt J
Matt J 2013 年 2 月 10 日
編集済み: Matt J 2013 年 2 月 10 日
You have a variable named "min" somewhere in your workspace. MATLAB thinks you are referring to this variable rather than the MIN function. Rename the variable to something that isn't a MATLAB function name.
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 10 日
Try
clear min
out=min(mintemp(:));
Internazionale
Internazionale 2013 年 2 月 10 日
how to find minimum value only in mintemp(:,:,1,1) ?
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 10 日
v=mintemp(:,:,1,1);
out=min(v(:))
Internazionale
Internazionale 2013 年 2 月 11 日
how about to find minimum value not only in mintemp (:,:,1,1) but also continue until (:,:,8,8) or the whole e. so, i get 64 minimum value.
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 2 月 11 日
Please, post correctly your question. Post a sample of your data, then ask clearly what you want.

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

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by