consider the following arrays defined in matlabs workspace: w=[1 0 0 0; 2 3 0 0 ;4 5 6 0 ;7 8 9 1] retreve the following sub-matrices from w  single line of matlab code: [2 0; 7 9] [0 0 0 0 0 0] [1 1]

Introductory Circuit Analysis (13th Edition)
13th Edition
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:Robert L. Boylestad
Chapter1: Introduction
Section: Chapter Questions
Problem 1P: Visit your local library (at school or home) and describe the extent to which it provides literature...
icon
Related questions
Question

consider the following arrays defined in matlabs workspace:

w=[1 0 0 0; 2 3 0 0 ;4 5 6 0 ;7 8 9 1]

retreve the following sub-matrices from w  single line of matlab code:

[2 0; 7 9]

[0 0 0 0 0 0]

[1 1]

Expert Solution
Step 1

Given Matrix W is

Electrical Engineering homework question answer, step 1, image 1

Now, first sub-matrix that is required is, say matrix X

Electrical Engineering homework question answer, step 1, image 2

Here the matrix X contains elements of matrix W as

2 = second row and first column of matrix W

0 = second row and third column of matrix W

7 = fourth row and first column of matrix W

9 = fourth row and third column of matrix W 

Step 2

So, in resultant matrix X, alternate elements of the second row and fourth row are needed along with alternate elements of the first and third columns.

To implement this using MATLAB, the required code will be

Electrical Engineering homework question answer, step 2, image 1

Ans=

Electrical Engineering homework question answer, step 2, image 2

This gives the required sub-matrix X.

Step 3

The second sub-matrix that is required from matrix W is, say matrix Y

Electrical Engineering homework question answer, step 3, image 1

These are the elements of matrix W formed by removing lower triangular matrix and forming array from the rest of elements such that matrix Y so formed will be of (1 X 6) dimension.

The elements of matrix W along with their linear indices are shown below. Linear indices are mentioned on the uppermost left corner.
Electrical Engineering homework question answer, step 3, image 2

 

 

steps

Step by step

Solved in 5 steps with 11 images

Blurred answer
Knowledge Booster
Type of method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, electrical-engineering and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Introductory Circuit Analysis (13th Edition)
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:
9780133923605
Author:
Robert L. Boylestad
Publisher:
PEARSON
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Electrical Engineering
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education
Fundamentals of Electric Circuits
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:
9780078028229
Author:
Charles K Alexander, Matthew Sadiku
Publisher:
McGraw-Hill Education
Electric Circuits. (11th Edition)
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:
9780134746968
Author:
James W. Nilsson, Susan Riedel
Publisher:
PEARSON
Engineering Electromagnetics
Engineering Electromagnetics
Electrical Engineering
ISBN:
9780078028151
Author:
Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:
Mcgraw-hill Education,