Posted By:
20 Mar, 2013 5:57 pm PDT

Create a matrix in Matlab with all entries same

I want to create a matrix of size m x n in Matlab that has all the same entries. For example, I want a matrix like this:

7 7 7 7 7
7 7 7 7 7


to create a matrix like above type the following

>>D = 7*ones(2,5)

This will create a matrix that has 2 rows and 5 columns, with all the entries 7.

Please watch the video for details

Was it useful?  

Please login to reply to this problem.

Related Problems on Fixoncloud