Search All of the Math Forum:

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

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

 Messages: [ Previous | Next ]
 Emrah Posts: 8 Registered: 12/30/12
Re: how to plot a function subject to constraints.
Posted: Jan 7, 2013 10:16 AM

"Matt J" wrote in message <kcenvl\$95v\$1@newscl01ah.mathworks.com>...
> "Emrah " <superonline21@hotmail.com> wrote in message <kcemb4\$2ah\$1@newscl01ah.mathworks.com>...
> > TideMan <mulgor@gmail.com> wrote in message <adfc55ca-51c8-4d03-a871-3829fd523c7d@googlegroups.com>...
> > > On Monday, January 7, 2013 9:25:09 AM UTC+13, Emrah wrote:
> > > > isn't there anyone to answer this?
> > >
> > > Answer what?
> > > I don't see a question, just a statement of the problem, which looks awfully like homework.
> > > What have you tried?
> > > In what way did it not work?
> > > Show us the code you've developed so far.

> >
> > ok mate, dont get angry :)
> > here is the code i have developed so far
> >
> > function objFuncPlot
> > [x2, x3] = meshgrid(0.1:.1:10, 0.1:.1:10);
> > %x1 and x4 is constant
> > x1=0.1996;
> > x4=0.2107;
> > %calculating constraints
> > [g1,g2,g3,g4,g5,g6,g7]=constraints(x1,x2,x3,x4);

>
> 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;
>
> Then plot as normal

error:

Error using horzcat
CAT arguments dimensions are not consistent.

Error in fplot2 (line 8)
G=[g1,g2,g3,g4,g5,g6,g7];

any idea?

Date Subject Author
12/30/12 Emrah
1/6/13 Emrah
1/6/13 Derek Goring
1/7/13 Emrah
1/7/13 Matt J
1/7/13 Emrah
1/7/13 Matt J
1/7/13 Emrah
1/7/13 Matt J
1/7/13 Emrah
1/7/13 Matt J
1/7/13 Emrah
1/7/13 Matt J
1/7/13 Matt J
1/7/13 Emrah