Write a function “createUniqueName” that will create a series of unique names. When the function is called, a string is passed as an input argument. The function adds an integer to the end of the string,
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:7| Question number:9.7
All Answers
total answers (1)
createUniqueName.m
function newfilename = createUniqueName(instr)
persistent count
if isempty(count)
count = 0;
end
count = count + 1;
newfilename = strcat(instr,int2str(count));
end
need an explanation for this answer? contact us directly to get an explanation for this answer