How to do strcmp in textboxes with Matlab

You can post your problem related to MATLAB Projects here. We will try our best to help you out.
Post Reply
Charles
Posts: 20
Joined: Sat Feb 18, 2017 7:12 am

How to do strcmp in textboxes with Matlab

Post by Charles » Mon Mar 06, 2017 12:58 pm

I would like to know how to compare strings between 2 textboxs in Matlab. Can someone please give some examples? Thank you in advantage.

theenggprojects
Site Admin
Posts: 25
Joined: Tue Feb 07, 2017 12:51 pm

Re: How to do strcmp in textboxes with Matlab

Post by theenggprojects » Thu Mar 09, 2017 8:18 am

Here's the command to compare two strings:

Code: Select all

tf = strcmp(s1,s2)
where s1 and s2 are the textboxes string and tf will return whether they are same or not. You should also have a look at this link to know more about this command: https://www.mathworks.com/help/matlab/ref/strcmp.html

Charles
Posts: 20
Joined: Sat Feb 18, 2017 7:12 am

Re: How to do strcmp in textboxes with Matlab

Post by Charles » Fri Mar 10, 2017 12:38 pm

theenggprojects wrote:
Thu Mar 09, 2017 8:18 am
Here's the command to compare two strings:

Code: Select all

tf = strcmp(s1,s2)
where s1 and s2 are the textboxes string and tf will return whether they are same or not. You should also have a look at this link to know more about this command: https://www.mathworks.com/help/matlab/ref/strcmp.html
It's worked !

Post Reply