Hello,
It turns out that you need to specify values for all of the SSC module's inputs, even if they are indicated as optional.
To make your life a little easier, in the latest update to SAM 2016.3.14 (Revision 4), we wrote a new code generator that creates code for the SDK in various languages, including for MATLAB. To use it, create a case in SAM with the performance and financial models you need (detailed photovoltaic in your case), and then on the case menu (click the little carrot on the case tab), click "Generate code" and choose a language and folder in which to save the files. You can then cut and paste the variable assignments from the file SAM generated into your file.
Best regards,
Paul.