How to change the values of the corners in a matrix
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
N/A
el 28 de Abr. de 2022
Respondida: Chunru
el 28 de Abr. de 2022
Hi,
Lets say I have a 100 * 100 matrix filled with zeros and I need to change the 4 corners to the value 1. What would be the best way to alter it?
0 comentarios
Respuesta aceptada
Chunru
el 28 de Abr. de 2022
a= zeros(10, 10); % smaller matrix for easy display
% for corners
a([1 end], [1 end]) = 1;
a
0 comentarios
Más respuestas (0)
Ver también
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!