Need help with creating 500 column vector
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Seong Nam
el 9 de Abr. de 2017
Comentada: Seong Nam
el 9 de Abr. de 2017
So this is the question from my college assignment;
Create a 500-element column vector P17M11 containing two hundred number 17's and followed by three hundred -11's
If I wanted to create separate columns for 17's and -11's, how would I write them so they can combine nicely?
0 comentarios
Respuesta aceptada
Stephen23
el 9 de Abr. de 2017
Editada: Stephen23
el 9 de Abr. de 2017
The assignment does not ask for 500 columns, but one column with 500 elements: "500-element column vector".
P17M11 = vertcat(17*ones(200,1),-11*ones(300,1))
You can learn these kind of basic MATLAB operations by working through the introductory tutorials:
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB 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!