Is there a quick function to make an array whose elements are the sum of the row and column numbers?
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Gabriel
el 26 de Jul. de 2024 a las 1:44
Comentada: Voss
el 26 de Jul. de 2024 a las 3:28
Hello! This should hopefully be a quick and easy question:
Is there a function such that the output of Fun(4) would be:
[2 3 4 5;
3 4 5 6;
4 5 6 7;
5 6 7 8]
i.e. each element of the matrix is equal to its row number + its column number?
I cannot figure out a way to search this question in a concise manner, so I haven't been able to find anything. I know this is fairly simple to code, but I'm curious if there's an already existing function for this. Thanks!
1 comentario
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!