Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Not equal command

Subject: Not equal command

From: LIM CHIAN CHIAN

Date: 17 Feb, 2011 17:33:04

Message: 1 of 5

May I know how to type not equal command in MATLAB or in M-file by using ~=?
Can anyone please give me example?

Subject: Not equal command

From: Sean de

Date: 17 Feb, 2011 18:06:03

Message: 2 of 5

"LIM CHIAN CHIAN" wrote in message <ijjm4g$a7j$1@fred.mathworks.com>...
> May I know how to type not equal command in MATLAB or in M-file by using ~=?
> Can anyone please give me example?


if x~=3
  disp('x is not equal to 3');
else
  disp('x is equal to 3');
end

Subject: Not equal command

From: LIM CHIAN CHIAN

Date: 19 Feb, 2011 11:38:25

Message: 3 of 5

"Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <ijjo2b$hnm$1@fred.mathworks.com>...
> "LIM CHIAN CHIAN" wrote in message <ijjm4g$a7j$1@fred.mathworks.com>...
> > May I know how to type not equal command in MATLAB or in M-file by using ~=?
> > Can anyone please give me example?
>
>
> if x~=3
> disp('x is not equal to 3');
> else
> disp('x is equal to 3');
> end

Thank you.
If I want to write a script to state that "if x is not an integer", what should I type in M-file?

Subject: Not equal command

From: Franck Dernoncourt

Date: 19 Feb, 2011 12:20:27

Message: 4 of 5

"LIM CHIAN CHIAN" wrote in message <ijoa3h$oic$1@fred.mathworks.com>...
> "Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <ijjo2b$hnm$1@fred.mathworks.com>...
> > "LIM CHIAN CHIAN" wrote in message <ijjm4g$a7j$1@fred.mathworks.com>...
> > > May I know how to type not equal command in MATLAB or in M-file by using ~=?
> > > Can anyone please give me example?
> >
> >
> > if x~=3
> > disp('x is not equal to 3');
> > else
> > disp('x is equal to 3');
> > end
>
> Thank you.
> If I want to write a script to state that "if x is not an integer", what should I type in M-file?

See http://www.mathworks.com/matlabcentral/newsreader/view_thread/163080

Subject: Not equal command

From: LIM CHIAN CHIAN

Date: 19 Feb, 2011 13:50:28

Message: 5 of 5

"Franck Dernoncourt" <franck.dernoncourt@gmail.com> wrote in message <ijocib$2go$1@fred.mathworks.com>...
> "LIM CHIAN CHIAN" wrote in message <ijoa3h$oic$1@fred.mathworks.com>...
> > "Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <ijjo2b$hnm$1@fred.mathworks.com>...
> > > "LIM CHIAN CHIAN" wrote in message <ijjm4g$a7j$1@fred.mathworks.com>...
> > > > May I know how to type not equal command in MATLAB or in M-file by using ~=?
> > > > Can anyone please give me example?
> > >
> > >
> > > if x~=3
> > > disp('x is not equal to 3');
> > > else
> > > disp('x is equal to 3');
> > > end
> >
> > Thank you.
> > If I want to write a script to state that "if x is not an integer", what should I type in M-file?
>
> See http://www.mathworks.com/matlabcentral/newsreader/view_thread/163080


Thanks!!

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us