필터 지우기
필터 지우기

Matlab 2012: bug in 2012 implementation of Max() !???

조회 수: 4 (최근 30일)
Amir
Amir 2012년 3월 13일
Try to to this:
max([1 2 5 2])
it then says:
Index exceeds matrix dimensions.
however for min([1 2 5 2]) or even mean([1 2 5 2]) there is no problem and they work fine.

답변 (1개)

Sean de Wolski
Sean de Wolski 2012년 3월 13일
This is because you have defined a variable by the name max:
whos max
and to fix it:
clear max
and then rename your variable something else (maybe the_max)
  댓글 수: 1
Jan
Jan 2012년 3월 13일
An evergreen.
Try this:
clear('max')
max(1:5)
max = rand(1, 5);
max(1:5)

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by