i want to create a array structure using one,zero,eye
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ajay kumar
el 2 de Feb. de 2016
Comentada: ajay kumar
el 2 de Feb. de 2016
use the ones, zeroes, eye and addressing commands as appropriate to construct the matrix D, by using upto three lines of command.
3 0 0 2 2
0 3 0 2 2
0 0 3 0 0
Thanks in advance
0 comentarios
Respuesta aceptada
Moe_2015
el 2 de Feb. de 2016
D=[3*eye(3),[2*ones(2);zeros(1,2)]]
You can do it in one line as seen here.
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!