Write a function with one input integer argument that returns an output matrix(MQ) which is a 2n by 2n matrix. MQ consist of 4 n-by-n submatrices top left are all ones top right corner are all 2's bottom left are 3's and bottom right are 4's
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Khalid Tewfik
am 28 Sep. 2016
Bearbeitet: Massimo Zanetti
am 28 Sep. 2016
function [MQ] = myquadrants(n) I don't know how to set up the matrix
0 Kommentare
Akzeptierte Antwort
Massimo Zanetti
am 28 Sep. 2016
Bearbeitet: Massimo Zanetti
am 28 Sep. 2016
Here it is.
function MQ = myquadrants(n)
MQ=[ones(n),2*ones(n);
3*ones(n),4*ones(n)];
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices 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!