Filter löschen
Filter löschen

help with hadamard matrix

2 Ansichten (letzte 30 Tage)
Dija
Dija am 3 Dez. 2014
Bearbeitet: Azzi Abdelmalek am 3 Dez. 2014
i have Hadamard matrix
N=8;
H=hadamard(N)
>>H =
1 1 1 1 1 1 1 1
1 -1 1 -1 1 -1 1 -1
1 1 -1 -1 1 1 -1 -1
1 -1 -1 1 1 -1 -1 1
1 1 1 1 -1 -1 -1 -1
1 -1 1 -1 -1 1 -1 1
1 1 -1 -1 -1 -1 1 1
1 -1 -1 1 -1 1 1 -1
i want to keep the same values of the first and the last column and the first row and change the others like this
H =
1 1 1 1 1 1 1 1
1 a a -a a -a a -1
1 a -a -a a a -a -1
1 -a -a a a -a -a 1
1 a a a -a -a -a -1
1 -a a -a -a a -a 1
1 a -a -a -a -a a 1
1 -a -a a -a a a -1

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 3 Dez. 2014
Bearbeitet: Azzi Abdelmalek am 3 Dez. 2014
H=hadamard(8);
a=10
H(2:end,2:end-1)=a*sign(H(2:end,2:end-1))
%or simply
H(2:end,2:end-1)=a*H(2:end,2:end-1)

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements 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