MATLAB: Error: Expression or statement is incorrect–possibly unbalanced (, {, or [.

Statistics and Machine Learning Toolboxsyntax errorunbalanced

I get the following error when I call the SVM function. I am using MATLAB 2008a.
>> [~, ~, cmat] = svm(numOfReturnedImages, dataset, queryImageFeature, metric);
??? [~, ~, cmat] = svm(numOfReturnedImages,> dataset, queryImageFeature, metric);
Error: Expression or statement is incorrect–possibly unbalanced (, {, or [.

Best Answer

The parentheses are correct, assuming there is not another typo where you forgot to include an extra parenthesis, bracket, or brace somewhere.
Based on John's suggestion, try this fix:
[unneeded, unneeded, cmat] = svm(numOfReturnedImages, dataset, queryImageFeature, metric);
And base on what Massimo said, you might want svmtrain() or svmclassify(), unless you have your own svm() function that you wrote.