Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Polynomial Matrix

Subject: Polynomial Matrix

From: Barry

Date: 29 Aug, 2010 17:40:07

Message: 1 of 4

m1=221.59;
xx=[4*10^-13, - 2*10^-09, 3*10^-06, - 0.0012 , 0.2824 , m1];

%Chiller Perfomance
D=B;
t1 = D<50; t2=D>50;
D(t1) = 0;
D(t2) = (polyval(xx,D));

PROBLEM
?? In an assignment A(I) = B, the number of elements in B and
 I must be the same.



What I want to do is apply the polynomial if value in matrix D is greater than 50 it works fine with linear equation.

Subject: Polynomial Matrix

From: ImageAnalyst

Date: 29 Aug, 2010 17:50:19

Message: 2 of 4

First tell us what your "B" is.
Basically it's saying that you can't assign, for example, 18 elements
to an single array element. 18 doesn't fit into 1. Make sense?

Subject: Polynomial Matrix

From: John D'Errico

Date: 29 Aug, 2010 18:02:04

Message: 3 of 4

"Barry " <barryoconnell2@gmail.com> wrote in message <i5e61n$219$1@fred.mathworks.com>...
> m1=221.59;
> xx=[4*10^-13, - 2*10^-09, 3*10^-06, - 0.0012 , 0.2824 , m1];
>
> %Chiller Perfomance
> D=B;
> t1 = D<50; t2=D>50;
> D(t1) = 0;
> D(t2) = (polyval(xx,D));
>
> PROBLEM
> ?? In an assignment A(I) = B, the number of elements in B and
> I must be the same.
>
>
>
> What I want to do is apply the polynomial if value in matrix D is greater than 50 it works fine with linear equation.

Actually, I doubt that it does work fine for a linear equation.
But with this small change, it will.

D(t2) = (polyval(xx,D(t2)));

See that I only evaluate the polynomial on the set of
points where I should do so.

John

Subject: Polynomial Matrix

From: Barry

Date: 29 Aug, 2010 18:10:07

Message: 4 of 4

ya that works well thanks very much just what i was looking for

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us