Question: LAB 5 ( Lab Work 3 ) ( Assignment ) BASIC CONCEPT, PROGRAM STRUCTURES AND FUNCTIONS IN MATLAB COEB 1 0 1 3 Programming for

LAB 5(Lab Work 3)(Assignment)
BASIC CONCEPT, PROGRAM STRUCTURES AND FUNCTIONS IN MATLAB COEB1013 Programming for Engineers / CSEB113 Principles of Programming
SEMESTER 12024/2025
Instructions
Complete the assignment in MATLAB script and submit your file(s) via BRIGHTEN. Name your file(s) using the format 'YourID_Shortname_Lab5'. Please indicate the question number in your script.
Ensure that all variables and parameters are named using the format 'variablename_XXXX,' where XXXX represents the last four digits of your student ID (i.e., length_1234=15.61).
Question 1: Variables and Arithmetic
a. Calculate the perimeter of a rectangle with length =15 and width =7.
b. Find the kinetic energy of a moving object with mass =20kg and velocity =5ms. Given KE=12mv2
Question 2: Vectors and Matrices
a. Create and display a vector of even numbers from 2 to 20.
b. Compute the product of two matrices:
A=[2367167], and B=[10431127]
c. Determine the transpose and inverse matrix of A and B in (b).
Question 3: Input/ Output
a. Write a script to calculate the total cost of materials for a construction project. Ask the user for:
Quantity of material.
Price per unit of material.
Display the total cost.
b. Prompt the user for the side length of a cube and calculate its surface area and volume. Display the answers.
c. Write a script to calculate the monthly payment for a loan using the equation:
M=Pr(1+r)n(1+r)n-1
where:
P : Loan amount (prompt user for input).
r : Monthly interest rate (e.g.,5% annual =0.0512).
n : Number of months (e.g.,3 years =312).
LAB 5 ( Lab Work 3 ) ( Assignment ) BASIC

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!