Index exceeds matrix dimensions when finding max value

前端 未结 3 1220
不思量自难忘°
不思量自难忘° 2020-12-12 02:40

I have been trying to find the max value from an array. But I keep getting the following error. Please advise.

scores = [19212       56722       73336                


        
3条回答
  •  旧时难觅i
    2020-12-12 03:30

    Have you defined an array called max ?

    scores = [19212       56722       73336       44805       47268 ]
    
    max(scores)
    
    ans = 73336
    

    If I define an array called max

    max=[1:10]
    
    max(scores)
    
    ??? Index exceeds matrix dimensions.
    

    Check by using the which function

    which max
    
    max is a variable.
    

    It should be

    which max
    
    built-in (C:\Program Files\MATLAB\R2009a\toolbox\matlab\datafun\@logical\max)  % logical method
    

提交回复
热议问题