Question: Please finish the following MATLAB function that takes a character vector ( str ) as the input and count the occurrence of the existing substring
Please finish the following MATLAB function that takes a character vector str as the input and count the occurrence of the existing substring word Eg the call to the function
CountThis is a test. 'test'
will return
Function strfindTEXTPATTERN returns the starting indices of any occurrences of PATTERN in TEXT.
function nCountstr word
bstrfindstrword;
Question options:
A
if ~isemptyb
nsizeb;
else
n;
end
B
if isemptyb
nsizeb;
else
n;
end
C
if ~isemptyb
nlengthb;
else
n;
end
D
if isemptyb
nlengthb;
else
n;
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
