0% found this document useful (0 votes)
37 views1 page

%Q.2 (B) To Compute An Approximate Value of The Integration by The Trapeziodal Method Int (Sinx) From 0 To Pi X 0:pi/100:pi y Sin (X) Z Trap (X, Y)

This document provides code to calculate the approximate value of an integral using the trapezoidal method. It defines the variables x as values from 0 to pi, y as the sine of x, and calculates the integral of sine from 0 to pi using the trapz function in MATLAB, giving an output value of 1.5708.

Uploaded by

Santosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

%Q.2 (B) To Compute An Approximate Value of The Integration by The Trapeziodal Method Int (Sinx) From 0 To Pi X 0:pi/100:pi y Sin (X) Z Trap (X, Y)

This document provides code to calculate the approximate value of an integral using the trapezoidal method. It defines the variables x as values from 0 to pi, y as the sine of x, and calculates the integral of sine from 0 to pi using the trapz function in MATLAB, giving an output value of 1.5708.

Uploaded by

Santosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 1

>> %Q.

2 (b) To compute an approximate value of the integration by the Trapeziodal method


int (sinx) from to pi
>> x!"pi#$"pi%
>> y!sin(x)%
>> z!trap(x&y)
>> z!trapz(x&y)
z !
$.'''(
>>

You might also like