i got this matrix question on my exam and i really had hard time with it

1 Ansicht (letzte 30 Tage)
can any one explain the sulotion of it please ? thank you.
  1 Kommentar
Rik
Rik am 2 Jun. 2021
What did you try? Did you read the documentation for each of those functions?
The solution is to divide the matrix in sections that can be created with only those three functions.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Kunal Kandhari
Kunal Kandhari am 2 Jun. 2021
This can be done using following line of code:
A = [zeros(2,3) ones(2,2); eye(5)]
Explaination:
zeros(2,3) will create array of zeros with 2 row and 3 column
ones(2,2) will create array of ones with 2 row and 2 column
eye(5) will create identity matrix of dimension 5
[zeros(2,3) ones(2,2)] will append ones after zero therefore resulting in
following matrix:
0 0 0 1 1
0 0 0 1 1
Now we want to append identity matrix below above obtained matrix
therefore we use semicolon after zeros and ones array and identity
matrix will be appended vertically
-----------------------------------------------------------------------------------------
You can refer following links for better understanding:
for creating array of zeros:
for creating array of ones:
for creating identity matrix:
  3 Kommentare
Marzouq harbi
Marzouq harbi am 4 Jun. 2021
this is not a homework my guy can you read the Q ? it is a Question that came in an exam and i already lost marks on it.
Rik
Rik am 4 Jun. 2021
So you did see that comment but not my first one? I'm sorry, but a few years here have made me a bit sceptic/cynical.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by