Borrar filtros
Borrar filtros

Negative index of a matrix

3 visualizaciones (últimos 30 días)
Burak
Burak el 2 de Ag. de 2016
Editada: Walter Roberson el 4 de Ag. de 2016
for n=1:5
for m=-n:n
a(m,n)=m*n
end
end
end
I got an equation like this but I got negative indexes , how can I solve this problem? Thanks for helping.

Respuesta aceptada

Thorsten
Thorsten el 2 de Ag. de 2016
Editada: Thorsten el 2 de Ag. de 2016
for n = 1:5
m = -n:n;
for i = 1:numel(m)
A(i, n) = m(i)*n;
end
end
  1 comentario
Burak
Burak el 2 de Ag. de 2016
Really thanks , I appreciate.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by