Borrar filtros
Borrar filtros

How can i zeroing elements in a matrix?

1 visualización (últimos 30 días)
Áron Laczkovits
Áron Laczkovits el 25 de Sept. de 2012
Comentada: DGM el 2 de Nov. de 2023
Well, My task is the following: i have a wav file, that i need to fft, then i load it to a matrix. I want to zeroing the first 10000 elements of the matrix. How can i do that?

Respuesta aceptada

Wayne King
Wayne King el 25 de Sept. de 2012
I'll assume you have a 1-D vector, if that vector is X, then just
X(1:1e4) = 0;
If this is not what you mean, please be more specific.
  2 comentarios
Dionysios Gkonis
Dionysios Gkonis el 2 de Nov. de 2023
if the matrix is n*n, how do you zero a row ?
DGM
DGM el 2 de Nov. de 2023
Doesn't matter whether it's square or not. Just address all elements of the row.
A = randi(9,4,4)
A = 4×4
2 5 4 6 5 1 7 1 4 6 8 6 1 3 7 9
A(2,:) = 0 % row 2, all columns
A = 4×4
2 5 4 6 0 0 0 0 4 6 8 6 1 3 7 9

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Fourier Analysis and Filtering 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