how to insert same scalar as length of something?
Mostrar comentarios más antiguos
Let's suppose, A = [1, 2, 3, 4, 5] and B = [0].
I want to make second [0,0,0,0,0] whose length is 5.
Please Let me know how to do this
Respuesta aceptada
Más respuestas (1)
Abderrahim. B
el 23 de Ag. de 2022
Editada: Abderrahim. B
el 23 de Ag. de 2022
Is this what you are trying to do?
A = [1,2,3,4,5] ;
myScalar = 2 ; % change this to the scalar value you want
B = myScalar*ones(size(A))
Categorías
Más información sobre Structures 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!