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:
Return the value of pi ...

Subject: Return the value of pi ...

From: Jamal Al-Yousef

Date: 9 Nov, 2010 17:21:04

Message: 1 of 4

Hi all,

I have declare the following z vector which result is integral function of
(x^4xsinx) interval from [0 to pi] as follows:-

z= int((x^4)*x*sin(x),0,pi)

when press enter the answer is:

ans =
 
pi^5-20*pi^3+120*pi

My question how i can substitute the pi value in the above answer , i need the complete answer shown the value : 62.8852 instead of the pi notation ??

Thanks in advance

Regards,

Jamal Alyousef

Subject: Return the value of pi ...

From: Sean

Date: 9 Nov, 2010 17:57:03

Message: 2 of 4

"Jamal Al-Yousef" <Bit_Bulldozer@YAHOO.COM> wrote in message <ibbvu0$9b$1@fred.mathworks.com>...
> Hi all,
>
> I have declare the following z vector which result is integral function of
> (x^4xsinx) interval from [0 to pi] as follows:-
>
> z= int((x^4)*x*sin(x),0,pi)
>
> when press enter the answer is:
>
> ans =
>
> pi^5-20*pi^3+120*pi
>
> My question how i can substitute the pi value in the above answer , i need the complete answer shown the value : 62.8852 instead of the pi notation ??
>



double(z)

Subject: Return the value of pi ...

From: Walter Roberson

Date: 9 Nov, 2010 18:02:22

Message: 3 of 4

On 09/11/10 11:21 AM, Jamal Al-Yousef wrote:

> ans =
>
> pi^5-20*pi^3+120*pi
>
> My question how i can substitute the pi value in the above answer , i
> need the complete answer shown the value : 62.8852 instead of the pi
> notation ??

Use vpa() if you need a symbolic numeric answer (e.g., to a large number
of digits.) Use double() if you need a binary floating point answer.

Subject: Return the value of pi ...

From: Jamal Al-Yousef

Date: 9 Nov, 2010 18:17:04

Message: 4 of 4

Walter Roberson <roberson@hushmail.com> wrote in message <P0gCo.20852$wQ1.20217@newsfe04.iad>...
> On 09/11/10 11:21 AM, Jamal Al-Yousef wrote:
>
> > ans =
> >
> > pi^5-20*pi^3+120*pi
> >
> > My question how i can substitute the pi value in the above answer , i
> > need the complete answer shown the value : 62.8852 instead of the pi
> > notation ??
>
> Use vpa() if you need a symbolic numeric answer (e.g., to a large number
> of digits.) Use double() if you need a binary floating point answer.


Thanks a lot.

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