How to create a symbolic matrix which is symmetric?
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Will Bolton
am 1 Mär. 2018
Kommentiert: Walter Roberson
am 1 Mär. 2018
Hello, I essentially want to create something with the form you would get from doing:
A = sym('A', [6,6])
but additionally I would like A to be symmetric and I'm not sure if there is an easy way to generate this?
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 1 Mär. 2018
Bearbeitet: John D'Errico
am 1 Mär. 2018
A = sym('A', [6,6]);
A = tril(A,0) + tril(A,-1).'
A =
[ A1_1, A2_1, A3_1, A4_1, A5_1, A6_1]
[ A2_1, A2_2, A3_2, A4_2, A5_2, A6_2]
[ A3_1, A3_2, A3_3, A4_3, A5_3, A6_3]
[ A4_1, A4_2, A4_3, A4_4, A5_4, A6_4]
[ A5_1, A5_2, A5_3, A5_4, A5_5, A6_5]
[ A6_1, A6_2, A6_3, A6_4, A6_5, A6_6]
Looks symmetric to me.
3 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!