Using MATLAB. Please pay attention to the (Restrictions), because the assessment
ID: 2292454 • Letter: U
Question
Using MATLAB. Please pay attention to the (Restrictions), because the assessment will be incorrect!?
Whitespace counter Write a function called WhitespaceCounter to determine the number of whitespace characters (i.e. blanks/spaces, tabs, etc.) in the string scalar userString. Restrictions: The function WhitespaceCounter must use the internal function isstrprop. Ex: >>str-"Hello, my name is G. Greg"; wsCountWhitespaceCounter(str) wsCount = Your Function Save C Reset MATLAB Documentation 1 function wsCount-WhitespaceCounter(userString) % Your function goes here S end Code to call your function C Reset str-"Hello, my name is G. Greg wsCount = WhitespaceCounter(str) Run FunctionExplanation / Answer
function wsCount = WhitespaceCounter(userString) space_matrix = isstrprop(userString,'wspace') wsCount = sum(space_matrix(:)==1) end