Q:

Write a function nchars that will create a string of n characters, without using any loops or selection statements

0

 Write a function nchars that will create a string of n characters, without using any loops or selection statements.

>> nchars('*', 6)

ans =

******

All Answers

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

nchars.m

function outstr = nchars(onechar, n)

outstr = blanks(n);

outstr = strrep(outstr,' ',onechar);

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