[v,ind]=max(X); [v1,ind1]=max(max(X)); disp(['The largest element in X is' num2str(v1) ' at (' num2str(ind(ind1)) ',' num2str(ind1) ')']);

Advertisements

季育澤的記事本

[v,ind]=max(X); [v1,ind1]=max(max(X)); disp(['The largest element in X is' num2str(v1) ' at (' num2str(ind(ind1)) ',' num2str(ind1) ')']);

Advertisements

%d bloggers like this:

Why calculate max(x) twice? Wouldn’t “[v1,ind1] = max(v)” be more efficient?

[v,ind]=max(max(X(:)));

[y,x] = ind2sub(size(X),ind);

do the same 🙂

You mean:

[v,ind]=max(X(:));

[y,x] = ind2sub(size(X),ind);

right?

Thanks for the tip 🙂

[…] https://chi3x10.wordpress.com/2008/11/12/the-index-of-the-largest-element-in-a-2d-matrix-in-matlab/ VN:F [1.9.20_1166]please wait…Rating: 0.0/10 (0 votes cast)Found it useful? Share this:EmailPrintTwitterMoreFacebookRelated Posts:ezyfit – An Alternative to Matlab’s Curve Fitting ToolboxImage Functions in MatlabUse XML files in Matlab Posted by Philipp Klaus at 21:13 Tagged with: matlab […]

i have a folder of image and have a array of indices of the images in that folder. have to compare the values in the array with the name of the images in the folder. when the match found that images has to be written in another folder. pls any give me some idea to do this. please help me..

WOW just what I was searching for. Came here by searching for

free picture gallerys of naked women

Hi, on occasion I see a 503 website message when I view your page. I thought you may wish to know, regards