Finding a sting - function findstr, MATLAB in Engineering

Finding a sting - function findstr:

The function findstr receives two strings as input arguments. It finds all the occurrences of shorter string contained by the longer, and returns the subscripts of the starting of the occurrences. The order of strings does not matter with findstr; it always finds the shorter string within the longer, whichever it is. The shorter string can consist of one character, or any of the number of characters. If there is more than one occurrence of the shorter string within the longer one, the findstr returns a vector with all the indices. Note that, what is returned is the index of the starting of the shorter string.

 

>> findstr('abcde', 'd')

ans =

4

>> findstr('d','abcde')

ans =

4

>> findstr('abcde', 'bc')

ans =

2

>> findstr('abcdeabcdedd', 'd')

ans =

4  9  11  12

Posted Date: 10/20/2012 5:28:34 AM | Location : United States







Related Discussions:- Finding a sting - function findstr, Assignment Help, Ask Question on Finding a sting - function findstr, Get Answer, Expert's Help, Finding a sting - function findstr Discussions

Write discussion on Finding a sting - function findstr
Your posts are moderated
Related Questions
Use polyval to evaluate the derivative at xder. This will be the % slope of the tangent line, "a" (general form of a line: y = ax + b). % 4. Calculate the intercept, b, of t

Creating Cell arrays: There are many ways to create cell arrays. For illustration, we will create a cell array in which one element will store an integer, one element store ch

Vector operations: As vectors are special cases of matrices, the matrix operations elaborated (addition, subtraction, multiplication, scalar multiplication, transpose) work on

Example of Exponential function modular program: In order to view the distinction in the approximate value for e as n increases, the user kept choosing Limit & entering larger

Algorithm for appex subfunction: The algorithm for appex subfunction is as shown:  Receives x & n as the input arguments.  Initializes a variable for running sum of t

Data structures: The Data structures are variables which store more than one value. In order to made sense to store more than one value in a variable, the values must in some

Execution steps: Whenever the program is executed, the steps below will take place: The script calcandprintarea starts executing. The calcandprintarea calls the readr

Example Exit modular program: In the illustration below, the user  Chose the Limit; -   Whenever prompted for n, entered the two invalid values before finally ente

I have a frequency response data. How do I convert that to state space? I am given a 6 row and 3 column data (steady state). How do i convert that to state space model?

Finding a sting - function strfind: The function strfind does necessarily similar thing, except that the order of the arguments does make dissimilarity. The common form is str