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:
Monomial basis value

Subject: Monomial basis value

From: fatih

Date: 20 May, 2013 13:09:08

Message: 1 of 2

Hi eveyrbody,

I have this question.
k=2;
Q=sym(zeros(k+1,1));
for i=1:k+1
    syms x
    Q(i,:)=x^(i-1);
end
Q
Q =
 
[ 1]
[ x]
[ x^2]

My first question is that: Is Q in a matrix form?
Second is that: What is the value of Q(i)*Q(j) for x=0 and x=1? How can I
write it in the programme?

Subject: Monomial basis value

From: Nasser M. Abbasi

Date: 20 May, 2013 21:38:07

Message: 2 of 2

On 5/20/2013 8:09 AM, fatih wrote:
> Hi eveyrbody,
>
> I have this question.
> k=2;
> Q=sym(zeros(k+1,1));
> for i=1:k+1
> syms x
> Q(i,:)=x^(i-1);
> end
> Q
> Q =
>
> [ 1]
> [ x]
> [ x^2]
>
> My first question is that: Is Q in a matrix form?

It depends on how you define a "matrix form"

The above looks like a vector to me. But others might it matrix as well in Matlab talk.

> Second is that: What is the value of Q(i)*Q(j) for x=0 and x=1? How can I
> write it in the programme?
>

help subs()

EDU>> i=1; j=2;
EDU>> r=Q(i)*Q(j)
  
x
  
EDU>> subs(r,x,0)
  
0
  
EDU>> subs(r,x,1)
   
1


--Nasser

Tags for this Thread

No tags are associated with 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