50 likes | 205 Views
Quiz 7. What function can be used to create two-dimensional character arrays without worrying about padding each row to the same length?, e.g., >>my_pets = [’dog’;’cat’]; strjust() blanks() char() isstrprop() strtrim(). Quiz 7 (cont).
E N D
Quiz 7 • What function can be used to create two-dimensional character arrays without worrying about padding each row to the same length?, e.g., >>my_pets = [’dog’;’cat’]; • strjust() • blanks() • char() • isstrprop() • strtrim()
Quiz 7 (cont) • In MATLAB, strings and substrings can be compared in what ways? • Two strings, or parts of two strings, can be compared for equality • Two individual characters can be compared for equality • Strings can be examined to determine whether each character is a letter or whitespace • All of the above • None of the above
Quiz 7 (cont) • What new function in MATLAB Version 7.0 replaces the older functions isletter() and isspace() which may be deleted in future versions of MATLAB? • sprintf() • findstr() • ischar() • isstrprop() • None of the above
Quiz 7 (cont) • Consider a string test defined as >>test = ‘This is a test!’; What is the result of the following command? • >>result = findstr(test, ‘is’) • result = 3 • result = [ 3 6] • result = [ 3; 6] • result = 6 • None of the above
Quiz 7 (cont) • What is the result of the following command? • >> sscanf(num2str(eval('3/2'),15),'%g') • ans = 1.5000 • ans = 1 • ans = ’’ • ??? Error using ==> sscanf • None of the above