Need a function that finds the monthly maximum discharge. It should output two values, the discharge itself and the row in which each value occurs. The code should extract results for all months in all years.
I have a data set that has discharge in first column, day, month then year in 2,3 and 4 columns.

댓글 수: 2

Rik
Rik 2021년 1월 20일
편집: Rik 2021년 1월 20일
Edit restored from Google cache. This thread is now also added to the Wayback Machine.
@George Sands Please don't edit away parts of your question after receiving an answer. That is very rude. It also looks like you deleted a comment, but unfortunately I can't restore that.
@dpb Could you flag this thread if there is more deleted content I could not restore?
dpb
dpb 2021년 1월 20일
@Rik I don't think there was any further comment...George never got back with sample data or additional questions so presume must have gotten his results from the hints given earlier.

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

 채택된 답변

dpb
dpb 2021년 1월 16일
편집: dpb 2021년 1월 16일

0 개 추천

Use a table or timetable and rowfun with grouping variables...a couple lines of code and an anonymous function will do it.
For the second desired output you may find augmenting the table with the row number may be the expeditious solution.

댓글 수: 1

dpb
dpb 2021년 1월 17일
Look at doc/examples for timetable, rowfun for starters. Give it a shot and show us what you have done and where get stuck. Look at section in importing data, too...
Attach a smallish sample datafile would help folks write specific code; you have a very generic description.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2021년 1월 16일

댓글:

dpb
2021년 1월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by