CS205 Intro. Computational Programming and Visualization
Practice Questions for Final Exam

The Final Exam (May 15 4-6pm in BA 259) will focus on these questions,
as well as the questions from the first midterm

This URL: http://www.stewart.cs.sdsu.edu/cs205/midterm2/index.html

NOTE: I hope you have examined the solution for midterm one Midterm 1 Solutions

I plan to pose these questions in the same manner as our first midterm. So you will be asked to give the contents of the MATLAB Workspace and some of the problems, that are still evolving, will involve user-defined functions.

Loops and Control Statements

Strings

Timing
The routines tic, toc were introduced to allow the programmer to determine the amount of CPU needed to complete a sequence of commands.

Graphics
Vector Operations
Draw a rough diagram of the expect MATLAB output for the following sequence of commands:
x = linspace(0,10,100); % create data
y = sin(x);
z = (y>=0) .* y; 
z = z + 0.5 * (y<0);
z = (x <=8) .* z;
plot(x,z),...
xlabel('x'),ylabel('z = f(x)'), title('A Discontinuous Signal')

File I/O
Draw a rough diagram of the expected MATLAB output for the following sequence of commands (this will involve a separate file):