Write a function nchars that will create a string of n characters, without using any loops or selection statements
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:7| Question number:20.7
All Answers
total answers (1)
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