Populating column Vector containing 200 17's followed by 300 -11's
Show older comments
I am having extreme trouble trying to figure out how to do a homework question.
The question is asking:
Create a 500-element Column vector P17M11 containing two hundred number seventeens followed by three hundred number negative elevens.
7 Comments
dpb
on 30 Jan 2015
repmat, mabye???
Brandon Jennings
on 30 Jan 2015
Star Strider
on 30 Jan 2015
What have you done with repmat? What have you tried?
It replicates the first argument in a matrix whose size is given by the second (#rows) and third (#columns) arguments.
Another option is the ones function, with scalar multiplication.
Brandon Jennings
on 30 Jan 2015
Star Strider
on 30 Jan 2015
Do the same thing with -11, then concatenate the two vectors.
Brandon Jennings
on 30 Jan 2015
dpb
on 30 Jan 2015
Type
doc
and then click on the "Getting Started" tab and work thru the tutorials on basic Matlab syntax and operations.
Answers (0)
Categories
Find more on Scripts in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!