1 / 5

Quiz 7

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).

nibal
Download Presentation

Quiz 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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()

  2. 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

  3. 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

  4. 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

  5. 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

More Related