From: Justin Perry on
i have a problem with a code of mine. when i try to run it, it says "Expression or statement is incorrect--possibly unbalanced (, {, or [." the line in question is

disp ([ ' It .: ' num2str ( iterNum ) ' Obj .: ' sprintf ('%10.4f',objective( iterNum )) ' Vol .: ' sprintf ('%6.3f',volCurr )])

not sure what is wrong with it. any help would be much appricated.
From: Jack Branning on
"Justin Perry" <perry_282(a)hotmail.com> wrote in message <hlrm2e$bg4$1(a)fred.mathworks.com>...
> i have a problem with a code of mine. when i try to run it, it says "Expression or statement is incorrect--possibly unbalanced (, {, or [." the line in question is
>
> disp ([ ' It .: ' num2str ( iterNum ) ' Obj .: ' sprintf ('%10.4f',objective( iterNum )) ' Vol .: ' sprintf ('%6.3f',volCurr )])
>
> not sure what is wrong with it. any help would be much appricated.

I'm not sure if this will work... try removing the square brackets and adding commas...

disp ( ' It .: ', num2str ( iterNum ), ' Obj .: ', sprintf ('%10.4f',objective( iterNum )), ' Vol .: ', sprintf ('%6.3f',volCurr ))
From: Justin Perry on
"Jack Branning" <jbr.nospam(a)nospam.com> wrote in message <hlrmqq$pjc$1(a)fred.mathworks.com>...
> "Justin Perry" <perry_282(a)hotmail.com> wrote in message <hlrm2e$bg4$1(a)fred.mathworks.com>...
> > i have a problem with a code of mine. when i try to run it, it says "Expression or statement is incorrect--possibly unbalanced (, {, or [." the line in question is
> >
> > disp ([ ' It .: ' num2str ( iterNum ) ' Obj .: ' sprintf ('%10.4f',objective( iterNum )) ' Vol .: ' sprintf ('%6.3f',volCurr )])
> >
> > not sure what is wrong with it. any help would be much appricated.
>
> I'm not sure if this will work... try removing the square brackets and adding commas...
>
> disp ( ' It .: ', num2str ( iterNum ), ' Obj .: ', sprintf ('%10.4f',objective( iterNum )), ' Vol .: ', sprintf ('%6.3f',volCurr ))

great thanks alot that worked. now on to figure out my next error.