Create the following matrices with the help of the matrix generation functions eye, ones, diag and triu. See the on-line help on these functions if required (i.e. help eye). Do not enter the matrices explicitly. Each matrix should be generated with a single command. b b b ---1-1-1 N= 0 b b P= 0 3 0 Q 00 b The variables a, b and c are already created for you. Don't forget to include your name as a comment in the script. Note: there is no partial credit for this problem. a 0 0 M= 0 a 0 0 a [200 004 с C C

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Whats wrong with my code? Variable N has an incorrect value how can i fix this?
1 a=randsample (2:9,1); b=randsample(-10:-2,1); c=b+1;
2 % Name
3 %Eye matrix generation M
4 M =
a*eye (3)
5 %triu matrix generation N
6 N = triu(a*ones (3))
7 %diag matrix generation P
8 P = diag([2,3,4])
9 %ones matrix generation Q
10 Q F cones (3,2)
Transcribed Image Text:1 a=randsample (2:9,1); b=randsample(-10:-2,1); c=b+1; 2 % Name 3 %Eye matrix generation M 4 M = a*eye (3) 5 %triu matrix generation N 6 N = triu(a*ones (3)) 7 %diag matrix generation P 8 P = diag([2,3,4]) 9 %ones matrix generation Q 10 Q F cones (3,2)
Create the following matrices with the help of the matrix generation functions eye, ones,
diag and triu. See the on-line help on these functions if required (i.e. help eye). Do not
enter the matrices explicitly. Each matrix should be generated with a single command.
a 0 0
M= 0 a 0 N=
00 a
[b b b
200
0 b b P= 0 3 0
0 0 b
004
с C
Q= C C
C C
The variables a, b and c are already created for you.
Don't forget to include your name as a comment in the script.
Note: there is no partial credit for this problem.
Transcribed Image Text:Create the following matrices with the help of the matrix generation functions eye, ones, diag and triu. See the on-line help on these functions if required (i.e. help eye). Do not enter the matrices explicitly. Each matrix should be generated with a single command. a 0 0 M= 0 a 0 N= 00 a [b b b 200 0 b b P= 0 3 0 0 0 b 004 с C Q= C C C C The variables a, b and c are already created for you. Don't forget to include your name as a comment in the script. Note: there is no partial credit for this problem.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education