Effacer les filtres
Effacer les filtres

Negative index of a matrix

3 vues (au cours des 30 derniers jours)
Burak
Burak le 2 Août 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.

Réponse acceptée

Thorsten
Thorsten le 2 Août 2016
Modifié(e) : Thorsten le 2 Août 2016
for n = 1:5
m = -n:n;
for i = 1:numel(m)
A(i, n) = m(i)*n;
end
end
  1 commentaire
Burak
Burak le 2 Août 2016
Really thanks , I appreciate.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by