필터 지우기
필터 지우기

i have an array, named ersum which have 20000 columns (1*20000). i need to find minimum value of first 50 columns. next minimum value of next 50 columns and so on upto last 50 in that 20000 columns. please send suitable code. thank you sir.

조회 수: 1 (최근 30일)
if ersum(:,counter)<ersum(:,counter+1) minind(:,k)=counter; else minind(:,k)=counter+1; end

답변 (1개)

Jos (10584)
Jos (10584) 2016년 4월 22일
you can RESHAPE your vector into a 50-by-N array and then use MIN which can operate on all columns at once.
help reshape
help min
Hint: start with a small example, with e.g. 4 instead of 50, and 12 instead of 20000 values.

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by