MATLAB Help: matlab max return wrong value?

  • Thread starter Thread starter yangf73
  • Start date Start date
  • Tags Tags
    Matlab Max Value
AI Thread Summary
The user is experiencing issues with MATLAB's max function, specifically when trying to find the maximum value along the fourth dimension, as the returned value is sometimes incorrect. They are seeking assistance and request that others provide their complete code for replication. A suggestion is made to ensure that the correct syntax, max(A,[],4), is being used. Additionally, there is a caution about potential naming conflicts with variables or functions that may interfere with the max function's operation. The discussion highlights common pitfalls in using MATLAB functions effectively.
yangf73
Messages
1
Reaction score
0
Hi,

I am using MATLAB max to find maximum along dimension 4. However I must made some mistake because the returned value is not the maximum sometimes:
ans =

142.1571
----------------
Can someone please help? Thanks.
 
Last edited:
Physics news on Phys.org
please post the entire code, something we can try to replicate

are you using

max(A,[],4)

?
 
Did you name a previous variable/function max?
 
I often think that some new members here misread the title of this site as psychicsforums rather than physicsforums. How else can you explain posts like this one. :wink:
 

Similar threads

Replies
4
Views
2K
Replies
4
Views
4K
Replies
5
Views
3K
Replies
2
Views
2K
Replies
9
Views
3K
Replies
1
Views
2K
Replies
10
Views
3K
Back
Top