Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shapiro Wilk Test in Matlab

Tags:

matlab

I have an array A with 100 numerical values. I want to test whether data in A is normally distributed using the Shapiro-Wilk test.

Si I write B = stats::swGOFT(A); on Matlab command line and I have the error:

??? B  = stats::swGOFT(A) Error: Unexpected MATLAB operator.
               |

Can someone please help me how can I use stats::swGOFT() correctly?

like image 232
user1987689 Avatar asked Jan 17 '13 16:01

user1987689


1 Answers

swGOFT is a MuPAD library, so you have to execute it from within MuPAD instead of from the MATLAB commandline itself. In the MATLAB commandline, type mupad and press enter. You'll get the so-called MuPAD notebook, where you can enter your command. And it should be B := stats::swGOFT(A) as Shai mentions in the comment.

Edit: To bring A from the Matlab workspace to the MuPAD workspace, you first have to change it into an object of type 'sym'. The steps would be:

  1. Create a sym object from A with the command S = sym(A)
  2. Create a named MuPAD notebook with note = mupad
  3. Send the variable S to note with setVar(note, S)
  4. Use S in the MuPAD commands instead of A, like: B := stats::swGOFT(S)
like image 94
Sundar R Avatar answered Oct 04 '22 06:10

Sundar R