ALPHA must be a scalar between 0 and 1, exclusive.

조회 수: 15(최근 30일)
João Lima
João Lima 2016년 12월 10일
답변: Brendan Hamm 2016년 12월 11일
Can anybody help me?
I had this exception in my code.
The error is indicated in this line:
saida_multcompare, tabela_multcompare, stats_multcompare] = multcompare(stats_ANOVA, [1 2],'display','off');
  댓글 수: 2
Star Strider
Star Strider 2016년 12월 10일
There are two different multcompare functions, each with different argument lists and different outputs.
Which one are you using?
What version of MATLAB are you using?
Your code does not match the documentation for either function that I have in R2016b.

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


Brendan Hamm
Brendan Hamm 2016년 12월 11일
Older versions of MATLAB did have a slightly different syntax for the multcompare function which was:
This has been changed in later releases to:
but the latter is backwards compatible ... that is the former statement works in any version of MATLAB.
That being said you are passing in a vector containing 2 values, 1 and 2. Now alpha represents the significance level used in the hypothesis test. We can only perform the test at a single significance level, so you cannot pass in a vector as you do. Furthermore, it makes no sense to perform a hypothesis test at a significance level of 0 or 1, so the allowed range of value is (0,1).
Maybe try a reasonable significance level:
saida_multcompare, tabela_multcompare, stats_multcompare] = multcompare(stats_ANOVA, 0.05,'display','off');
If this was not what you intended, you will have to explain what you were trying to do with that function call above? What does [1,2] represent?

Community Treasure Hunt

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

Start Hunting!

Translated by