Fill in a matrix
Mostrar comentarios más antiguos
I want to create a row matrix of 16 elements and fill in the first 8 elements (as well as the last 8 elements) of it, with integers from 1 to 8.
i.e. result = ( 2 5 2 8 4 1 4 7 3 5 3 7 8 4 6 6 )
Any help could be useful. thanks in advance!
1 comentario
Azzi Abdelmalek
el 10 de En. de 2015
You can just ask to create a matrix with 16 elements taken randomly from 1 to 8
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 10 de En. de 2015
randi(8,1,16)
Categorías
Más información sobre Resizing and Reshaping Matrices 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!