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 =


>> strcmp(word1,word3)

ans =


>> strcmp(word1,word1)

ans =


>> strcmp(word2,word4)

ans =


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 call: In the function call, not any arguments are passed so there are no input arguments in the function header. The function returns an output argument, therefore th

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.

Replacing, Finding, and separating strings: There are numerous functions which find and replace the strings, or parts of strings, within the other strings and functions which

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

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

i want to run 4 instances of my matlab code on 4 processor cores. im executing the job from head node. i created a parallel job and assigned number of workers. but i don''t get bac

True color matrice: The true color matrices are the other way to represent images. The true color matrices are 3-dimensional matrices. The first two coordinates are the coordi

IS Functions for Strings: There are many functions for strings, that return logical true or false. The function isletter returns the logical true when the character is a lette