You are on page 1of 3

CS10-8L: Computer Programming Laboratory

Machine Problem #14: Loops

Name: JINGONA, Fatimah Rahima T. Score:


Section: OL68 Date: 11-2-20

OBJECTIVES
● To familiarize the students with the MATLAB interface.
● To enable the students to use some basic operations.

Instructions:
1. Save your file as Surname_Firstname_MP14. Ex. Santos_Jared_MP14

2. You will submit a zip file containing the following and send it to BB.

a. PDF file of Machine Problem 14 provided with the screenshot of your answers.
b. MATLAB script with .m extension.

3. Your program must have comments for each section.


Header Comments:
%{
This demo program shows how good a MATLAB program is
Written by: Raymond Sedilla
Date: August 27,2020
Time: 2:20pm
Program: BSIE
Course: CS10-8L
Section: B20
School: Mapua University
%}

MACHINE PROBLEM

1. Given an array of integers, find the maximal absolute difference between any two of its adjacent elements.

INPUT OUTPUT

1. [2, 4, 1, 0] 3
2. [1, 1, 1, 1] 0
3. [-1, 4, 10, 3, -2] 7
4. [10, 11, 13] 2

In the editor window, take a screenshot and paste your output:

Prepared by: Raymond Sedilla, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #14: Loops

In the command window, take a screenshot and paste your output:

Prepared by: Raymond Sedilla, Mapua University


CS10-8L: Computer Programming Laboratory
Machine Problem #14: Loops

Prepared by: Raymond Sedilla, Mapua University

You might also like