Help: matlab max return wrong value?

  • Context: MATLAB 
  • Thread starter Thread starter yangf73
  • Start date Start date
  • Tags Tags
    Matlab Max Value
Click For Summary

Discussion Overview

The discussion revolves around an issue with the MATLAB function 'max', specifically regarding its behavior when finding the maximum value along the fourth dimension of an array. Participants are seeking clarification on the unexpected results returned by the function.

Discussion Character

  • Technical explanation, Debate/contested, Meta-discussion

Main Points Raised

  • One participant reports that the maximum value returned by MATLAB's max function is not as expected, suggesting a potential error in their code.
  • Another participant requests the entire code to replicate the issue and confirms the usage of the syntax max(A,[],4) as a point of clarification.
  • A third participant raises a question about whether the user has inadvertently named a previous variable or function 'max', which could lead to unexpected behavior.
  • A fourth participant comments on the nature of the post, suggesting that some users may misinterpret the forum's focus, indicating a broader concern about the quality of questions being asked.

Areas of Agreement / Disagreement

There is no consensus reached in the discussion, as participants are exploring different aspects of the issue without resolving the underlying problem.

Contextual Notes

Participants have not provided the complete code or context, which may limit the ability to diagnose the issue accurately. There is also a potential ambiguity regarding the naming of variables or functions that could affect the results.

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
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K