Sql Length Function Syntax Matlab For Loop