Borrar filtros
Borrar filtros

help with hadamard matrix

2 visualizaciones (últimos 30 días)
Dija
Dija el 3 de Dic. de 2014
Editada: Azzi Abdelmalek el 3 de Dic. de 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

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 3 de Dic. de 2014
Editada: Azzi Abdelmalek el 3 de Dic. de 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)

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by