Clear Filters
Clear Filters

help with hadamard matrix

2 views (last 30 days)
Dija
Dija on 3 Dec 2014
Edited: Azzi Abdelmalek on 3 Dec 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

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 3 Dec 2014
Edited: Azzi Abdelmalek on 3 Dec 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)

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!