views:

37

answers:

1

Following is the statement inside my code I am using in Matlab:

[h_sgsim,p_sgsim,ci_sgsim] = ttest(q_mean_sgsim_yearly_TankMethod,q_mean_reference_truth_yearly_TankMethod(1));

where q_mean_sgsim_yearly_TankMethod is a 100 X 1 vector and q_mean_reference_truth_yearly_TankMethod(1) is a scalar.

I don't know why its giving the error even when in definition of function 'ttest' the first two arguments are vector and scalar respectively.alt text

+1  A: 

I'm getting no errors. Here's an example:

» [h,p,ci] = ttest(randn(100,1),0.1)
h =
     0
p =
      0.84298
ci =
     -0.10756
      0.35373

Although I have to say you had ridiculously long variable names, maybe you mistyped something..

Amro
Hi Amro...I've rechecked the variable names (its long for purpose :P) and its still giving the same error. Please see the attached snapshot.
Harpreet
Oh, and I checked your exact example, somehow that is also giving the same error :P
Harpreet
I'm not sure.. perhaps check if you are using the correct version of the functions `which ttest` and `which nanmean` (they both should be inside the STATS toolbox). you can always set `dbstop if error` and enter debug mode where it hits that error??
Amro
My nannmean is in mGstat toolbox, however ttest is in STATS toolbox. Any suggestions further?
Harpreet
well obviously you have a name conflict: open the `pathtool`, select the folders belonging to your custom mGstat toolbox, and hit "move to bottom". Its always a good idea to have MATLAB's official toolboxes first on the path (unless you intentionally want to override some function)
Amro
You are Matlab Guru Amro :)!!
Harpreet

related questions