Write a MATLAB code that generates a random upper-triangular matrix U of size n.
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am new to MATLAB and not sure how to start. please help. Write a MATLAB code that generates a random upper-triangular matrix U of size n.
2 Kommentare
Guillaume
am 13 Apr. 2017
" not sure how to start"
By making an effort? This, or something similar, is going to be covered in any book or tutorial about matlab within the first few chapters if not the first.
Stephen23
am 13 Apr. 2017
Well, how about doing the Introductory Tutorials:
and reading this:
Antworten (2)
KSSV
am 13 Apr. 2017
n = 10 ;
A = zeros(n) ;
for i = 1:n
for j = 1:n
if i<j
A(i,j) = rand ;
end
end
end
Also check triu
0 Kommentare
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!