Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 Function

Explanation / Answer

function wsCount = WhitespaceCounter(userString) space_matrix = isstrprop(userString,'wspace') wsCount = sum(space_matrix(:)==1) end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote