Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: how to plot a function subject to constraints.
Replies: 14   Last Post: Jan 7, 2013 1:15 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Matt J

Posts: 4,992
Registered: 11/28/09
Re: how to plot a function subject to constraints.
Posted: Jan 7, 2013 10:38 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Emrah " <superonline21@hotmail.com> wrote in message <kceorn$cop$1@newscl01ah.mathworks.com>...
>
> > Set x2 and x3 to NaN where the constraints are not satisfied, e.g.,
> >
> > G=[g1,g2,g3,g4,g5,g6,g7];
> > infeasible=~all(G(:));
> > x2(infeasible)=nan;
> > x3(infeasible)=nan;

================

Make that

infeasible=~all(G(:)<=0);


>
> Error using horzcat
> CAT arguments dimensions are not consistent.
>
> Error in fplot2 (line 8)
> G=[g1,g2,g3,g4,g5,g6,g7];
>
> any idea?

==============

Nope. Don't you expect all g1....g7 to be the same size? If not, it should be obvious to you why it might not be possible to concatenate them. If so, did you check what sizes they are? What happens when use DBSTOP to pause execution at line 8 and do
"whos g*"



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.