필터 지우기
필터 지우기

Writing a vector function, find median without using median()

조회 수: 2 (최근 30일)
sok sim
sok sim 2012년 4월 18일
Write a function to calculate the median of a vector of numbers. Your function should work whether a column vector or row vector is passed as the actual parameter. Do not use the built-in function median() rather sort your vector and then find the middle value. Remember that if your vector has an even number of elements, then the median is the arithmetic mean of the middle two values. You may want to look at the reshape() function or review how to transpose a matrix.
  댓글 수: 8
Jan
Jan 2012년 4월 19일
And it seems like sok sim does not care about comments.
Walter Roberson
Walter Roberson 2012년 4월 19일
I struggle to resist the temptation to provide correct but incomprehensible answers that prove it can be done but which any teacher would fail as being obviously copied.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by