From: Erik Andersson on 28 Apr 2010 15:26 Hello! I have a n*m*t matrix wher a=8, b=20, c=20. In this matrix a have calculated error in different values. Now I want to find the indexvalues, i.e. the values of n, m and t where the minimumerrorvalue of the matrix is? Thankfull for help! /E
From: Sean on 28 Apr 2010 15:41 "Erik Andersson" <annerk02(a)student.umu.se> wrote in message <hra24c$di4$1(a)fred.mathworks.com>... > Hello! > I have a n*m*t matrix wher a=8, b=20, c=20. In this matrix a have calculated error in different values. Now I want to find the indexvalues, i.e. the values of n, m and t where the minimumerrorvalue of the matrix is? > > Thankfull for help! > > /E >> [my_min, idx] = min(matrix); >>[row, col, pag] = ind2sub(size(matrix),idx);
From: Walter Roberson on 28 Apr 2010 15:41 Erik Andersson wrote: > Hello! > I have a n*m*t matrix wher a=8, b=20, c=20. In this matrix a have > calculated error in different values. Now I want to find the > indexvalues, i.e. the values of n, m and t where the minimumerrorvalue > of the matrix is? [minval, idx] = min(TheMatrix(:)); [aidx, bidx, cidx] = ind2sub(size(TheMatrix), idx);
From: Bruno Luong on 28 Apr 2010 15:42 "Erik Andersson" <annerk02(a)student.umu.se> wrote in message <hra24c$di4$1(a)fred.mathworks.com>... > Hello! > I have a n*m*t matrix wher a=8, b=20, c=20. In this matrix a have calculated error in different values. Now I want to find the indexvalues, i.e. the values of n, m and t where the minimumerrorvalue of the matrix is? > % Generate the test matrix M=rand(8,20,20) % engine [minM idx] = min(M(:)); [n m t] = ind2sub(size(M),idx) % check minM M(n,m,t) % Bruno
From: someone on 28 Apr 2010 15:48 "Erik Andersson" <annerk02(a)student.umu.se> wrote in message <hra24c$di4$1(a)fred.mathworks.com>... > Hello! > I have a n*m*t matrix wher a=8, b=20, c=20. In this matrix a have calculated error in different values. Now I want to find the indexvalues, i.e. the values of n, m and t where the minimumerrorvalue of the matrix is? > > Thankfull for help! > > /E % Something like this (may take some tweaking): % I'm not sure what your a, b, & c above are. % First use the min command with the ind option: [c,ind] = min(A(:)); % then use the ind2sub command % convert the llinear index to array subscripts: [n,m,t] = ind2sub(size(A),ind)
|
Next
|
Last
Pages: 1 2 Prev: bluring an image with 1D FIR filter Next: Execute an m file from the command line |