(Ones (2,3) Zeros (2) Eye (3) Ones (3,1) Zeros (3,1) )
(Ones (2,3) Zeros (2) Eye (3) Ones (3,1) Zeros (3,1) )
Section: ECE12S1
[ones(1,5)*pi;ones(1,5);zeros(1,5);ones(1,5)]
[sqrt(2)*ones(3)]
B. In MATLAB enter the following matrices use appropriate format. Write your syntax in the space
provided.
MATLAB Syntax
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”
Syntax for Matrix C : C = [4 5/4 9/4; 1 2 3]
Using MATLAB commands and the Matrices in above compute the following expressions if possible.
Write the MATLAB SYNTAX you used and MATLAB out put on the space provided
1. Product of A and C
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”
4. Sum of the product of A and its transpose and the product of C and its transpose.
5. Product of A and B
C. A matrix (plural matrices) is sort of like a “box” of information where you are keeping track of things
both right and left (columns), and up and down (rows).
As an example, if you had three sisters, and you wanted an easy way to store their age and number of
pairs of shoes, you could store this information in a matrix. The actual matrix is inside and includes the
brackets:
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”
Solve the following problem using MATLAB. Write the syntax and the MATLAB out put on the space provided.
1. The grades of 3 students in a test are 95, 92,80 respectively; in projects are 100, 80 and 90;homework
100, 100 and 90; and in the quiz are 75;80and 90 . The tests are 40% of the grade, projects 15%,
homework 25%, and quizzes 20%.. Organize the data in a matrix and perform necessary operation to
find the final grades of the 3 students. Use MATLAB to verify the answer.
>>therefore the final grades of the 3 students are 93, 89.8 and 86.
2. An outbreak of a virus hit the local public schools. Approximately 15% of the male and female juniors
and 25% of the male and female seniors are currently healthy, 35% of the male and female juniors
and 30% of the male and female seniors are currently sick, and 50% of the male and female juniors
and 45% of the male and female seniors are carriers of virus.
There are 100 male juniors, 80 male seniors, 120 female juniors, and 100 female seniors.
Using two matrices and one matrix equation, find out how many males and how many females (don’t need
to divide by class) are healthy, sick, and carriers.
≫HEALTHY=78
SICK=131
CARRIERS=191
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”
SCREENSHOT
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”
B
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”