create a matrix with the same entry

I would like to create, given x and NRows, a vector y that is NRows*1 and every element of y is x. Please advise.

 Accepted Answer

Something like this maybe?
y=x*ones(NRows,1);

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products

Asked:

on 14 Apr 2018

Answered:

Rik
on 14 Apr 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!