changing value in a 2d array
Mostrar comentarios más antiguos
hi, thank you for your help.
I would like to know how to change values in a 2d array. For example, I have an 2d array A as of 1000x1000, of all zero values
I want to change value in position, 1x1, 1x100, 1x1000 to value 1.
do you know a quick way of doing this?
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 11 de Jul. de 2011
A(1,[1 100 1000]) = 1;
1 comentario
charlie
el 11 de Jul. de 2011
charlie
el 11 de Jul. de 2011
4 comentarios
James Tursa
el 11 de Jul. de 2011
Please post your code, or a simplified version of it that will show the problem you are having.
Oleg Komarov
el 12 de Jul. de 2011
It doesn't loop, but it outputs the result on the command window. Use ";" as included in the code snippets to supress screen print.
bym
el 12 de Jul. de 2011
agree with Oleg, just didn't post soon enough!
charlie
el 12 de Jul. de 2011
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!