Comparing strings, MATLAB in Engineering

Comparing strings:

There are few functions which compare strings and return logical true when they are equivalent or logical false when not. The function strcmp compares the strings, character by character. It returns the logical true if strings are completely similar (it also infers that they should be of similar length) or logical false if the strings are not of similar length or any equivalent characters are not identical. Here are some illustrations of such comparisons:

>> word1 = 'cat';

>> word2 = 'car';

>> word3 = 'cathedral';

>> word4 = 'CAR';

>> strcmp(word1,word2)

ans =

0

>> strcmp(word1,word3)

ans =

0

>> strcmp(word1,word1)

ans =

1

>> strcmp(word2,word4)

ans =

0

Posted Date: 10/20/2012 5:26:13 AM | Location : United States







Related Discussions:- Comparing strings, Assignment Help, Ask Question on Comparing strings, Get Answer, Expert's Help, Comparing strings Discussions

Write discussion on Comparing strings
Your posts are moderated
Related Questions
Function cellplot - Cell array: The function cellplot place a graphical display of the cell array in a figure Window; though, it is a high-level view and fundamentally just di

Program of passing arguments to functions: This was an illustration of a function which did not receive any input arguments nor did it return any output arguments; it easily a

Function used in sound files: The MATLAB has numerous other functions which let you read and play sound or audio files. In the audio files, sampled data for each audio channel

Removing Whitespace Characters: The MATLAB has functions which will eliminate trailing blanks from the end of a string and/or leading blanks from the starting of a string.

Function used in binary search: The function below implements this binary search algorithm. It receives two arguments: the sorted vector and a key (on the other hand, the func

A matlab function to calculate filter order

Gauss Elimination: The Gauss elimination technique consists of:    Generating the augmented matrix [A b]    Applying EROs to augmented matrix to obtain an upper trian

Individual structure variable: The individual structure variable for one software package may look like this: The name of the structure variable is a package; it has f

Illustration of Gauss elimination: For illustration, for a 2 × 2 system, an augmented matrix be: Then, the EROs is applied to obtain the augmented matrix into an upper

Inverse of square matrix: The inverse is, hence the result of multiplying the scalar 1/D by each and every element in the preceding matrix. Note that this is not the matrix A,