From: Justin Perry on 21 Feb 2010 11:13 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 21 Feb 2010 11:26 "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 21 Feb 2010 11:39 "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.
|
Pages: 1 Prev: Simple question reagriding saving in an array Next: How to put on GUI a web camera |