0% found this document useful (0 votes)
10 views

Assignment 2 questions

numerical methods for analysis

Uploaded by

danielnavratil00
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Assignment 2 questions

numerical methods for analysis

Uploaded by

danielnavratil00
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

APSC 256 Numerical Methods for Analysis – Assignment 2

Submit your work in Canvas as a single PDF file, 1 mark in total


1. (0.3 marks) Write a MATLAB (M-) script file that uses a for-loop to determine the sum of the 20 terms in the
series 3k2 for k = 1, 2, 3, …, 20.

2. (0.4 marks) Write a MATLAB (M-) script file that uses a for-loop and if-elseif-else structure to plot the function
 x 2 + 1, x < 0

y(x=)  3 x + 1, 0 ≤ x < 10
9sin(5 x − 50) + 31, x ≥ 10

for x spanning from –5 to 15 with steps of 0.01. Use appropriate labels on your x-axis and y-axis. Show the
resulting plot. Hint: create a for-loop that steps an index i through all values of x(i) while solving for values of y(i).

3. (0.3 marks) Answer the following questions about base-10 representations.


Given an eight-digit base-10 (decimal) computer system, a floating point number can be represented by one
mantissa sign digit, four mantissa digits, one exponent sign digit, and two exponent digits. Express the floating
point presentation in terms of base-10 exponential number format with mantissa and exponent; state the largest
and smallest positive values, and the machine precision for the eight-digit computer system.

You might also like