0% found this document useful (0 votes)
24 views2 pages

Assignment 01 Summer2023

This document provides instructions for 5 MATLAB assignments: 1) Approximate an integral using rectangles and include MATLAB code 2) Evaluate expressions using high accuracy in MATLAB 3) Evaluate a summation converging to pi^2/6 for different values of m and calculate the error 4) Assign values to variables and evaluate a function for capacitor voltage drop at times t, plot the function, and add axes labels 5) Modify a function to compute a sum for pi and test it for different values of m, displaying m and the sum rounded to 3 decimal places.

Uploaded by

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

Assignment 01 Summer2023

This document provides instructions for 5 MATLAB assignments: 1) Approximate an integral using rectangles and include MATLAB code 2) Evaluate expressions using high accuracy in MATLAB 3) Evaluate a summation converging to pi^2/6 for different values of m and calculate the error 4) Assign values to variables and evaluate a function for capacitor voltage drop at times t, plot the function, and add axes labels 5) Modify a function to compute a sum for pi and test it for different values of m, displaying m and the sum rounded to 3 decimal places.

Uploaded by

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

ECE 3040

Assignment #1

1. Approximate the following integral employing five rectangles, as shown in the figure. Use
Matlab to perform all calculations and include it in you solution.

2. Use Matlab to evaluate the following expressions (employ the highest accuracy available):

a.

b.

c.

3. The following sum converges to 2/6, as m approaches infinity

Employ Matlab to evaluate the above summation (employ format long) for:
a. m=10
b. m=100
c. Calculate the true error (2/6 – approximate_value) for each case.

4. Use Matlab to assign values to the variables as follows: V=12, R=50, L=5 and C=10-4. The
following function is the solution of the capacitor voltage drop in a series RLC electric
circuit.

a. Evaluate the function v for t=0.1 and t=0.5 (employ format short).
b. Plot v vs. t, from t=0 to 0.7 employing the plot command.
c. Add a grid, x-axis title ‘t’ and y-axis title ‘v(t)’ .

5. Modify the function series2_mh from lecture 4 to compute the sum:

Name your function series_pi. Save the sum in variable S_sum. Your function should employ
fprintf commands to display the value of m and S_sum (use 3 decimal places for S_sum). The two-
line output should look like this:
m = ……
S_sum = ………

Test the function series_pi for m = 5, m = 10, and m = 100.

You might also like