MATLAB: Unbalanced or unexpected parenthesis or bracket.

errorparenthesis

Not sure where the unbalance/unexpected bracket is.. I count 1 open and 1 close… This is literally the first time I've used MatLab.. just trying to produce a chart from a few Excel spreadsheets, using a pre-made code that has been used for this before.
The error I receive is:
??? Error: File: NatTest.m Line: 1 Column: 21
Unbalanced or unexpected parenthesis or bracket.
And the Code it refers to:
function []=NatTest('SAP6';5;1;10;75);
%%%function []=read_gs(corename,dstart,dz,dend,hlines);
%%%Reads LS grainsize files and puts them in a matrix plotted pltgrsz
%%%grain size files must be consistently labels in depth
%%%ex. corename='BI17';
%%%%%dstart=1 -> starting depth is at 1cm
%%%%%dz =1 -> sample spacing is 1 cm
%%%%%dend =10 -> final sample depth is 10 cm
%%%%%hlines= 75 -> number of header lines in grainsize file
%%%%%usually 75 with grainsize statistics selected
count=0; %zeroing counter variable
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Loop to read in all grainsize files
Help please?

Best Answer

The form
function []=NatTest(something)
is used to define a function named NatTest, not to call the function. In the parameter list that I marked as "something", you cannot have any constants, only argument names (or, if you have a new enough MATLAB, the symbol ~ instead of an argument name)
To call the routine with the parameters 'SAP6',5,1,10,75 you would do that from outside the function.
Note also: you need to use comma to separate arguments, not semi-colon
Looking at your comments, you probably want
function [] = NatTest(corename,dstart,dz,dend,hlines)