Q:

Write a function myones that will receive two input arguments n and m and will return an nxm matrix of all ones. Do NOT use any builtin functions (so, yes, the code will be inefficient). Here is an example of calling the function:

0

 Write a function myones that will receive two input arguments n and m and will return an nxm matrix of all ones. Do NOT use any built-in functions (so, yes, the code will be inefficient). Here is an example of calling the function:

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

myones.m

function outmat = myones(n,m)

for i = 1:n

 for j = 1:m

 outmat(i,j) = 1;

 end

end

end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now