In: Computer Science
The language is MATLAB
Write a function that will generate three random integers, each in the inclusive range from 10 to 80. It will then return a string consisting of the three integers joined together, and also a character vector consisting of the three integers joined together. For example, if the random integers are 11, 29, and 76, the string that is returned will be "112976" and the character vector that is returned will be '112976'.
I'm really confused on this one, so if anyone can help me out, I'd appreciate it!
% MATLAB Program to generate random string and character vector function [strVector, charVector] = RandomCharcterVector() strVector = string(mat2str(randi([10,80],1,3))); strVector = erase(strVector, '['); strVector = erase(strVector, ' '); strVector = erase(strVector, ']'); charVector = convertStringsToChars(strVector); end