This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ..) or Y = ones([m n p . ..]) The size inputs m , n , p , ... should be nonnegative integers. Negative integers are treated as 0. mbynbypby... array of 1 s. Y = ones(size(A)) Matrix A array of 1 s that is the same size as A ones(m,n,. ..,classname) or ones([m,n,. ..],classname) classname can have the following values: 'double' , 'single' , 'int8' , 'uint8' , 'int16' , 'uint16' . mbynby. .. array of 1s of data type classname Sample Code: The following code creates a 2by5 matrix of 1s. Y= ones(2,5,'int16') Sample Output: Y = 1 1 1 1 1 1 1 1 1 1 Family Name: KINGSHUK First Name: BARUA Student Number: 3713908 : ECTE906  Assignment 1 P.Doulai Instructions/Guidelines (MATLAB Tasks/Tut/Function/Lab Report) Mathematics Elementary Matrices and Arrays...
View
Full
Document
 Three '10
 Pd

Click to edit the document details