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:
Matlab 2007b_Matlab 2010a question

Subject: Matlab 2007b_Matlab 2010a question

From: Aidy

Date: 5 Jan, 2011 04:25:24

Message: 1 of 6

hi everyone,

i have a matlab script, when i open it on the following line:

[~,a] = ismember(b,c,'rows');

I get an error on this line in Matlab 2007b when i run the code , the error is :
"Expression or statement is incorrect--possibly unbalanced (, {, or [ "

However, no such error issue when I run the exact script in Matlab 2010a.

Please, can anyone share as to why this is so?

all the best,
aidy

Subject: Matlab 2007b_Matlab 2010a question

From: Aidy

Date: 5 Jan, 2011 04:58:08

Message: 2 of 6

tilde was the issue, only introduced in 2009 versions for dummy variables

--aiden

Subject: Matlab 2007b_Matlab 2010a question

From: Steven_Lord

Date: 5 Jan, 2011 14:46:35

Message: 3 of 6



"Aidy " <aidenjobe@gmail.com> wrote in message
news:ig0rrk$191$1@fred.mathworks.com...
> hi everyone,
>
> i have a matlab script, when i open it on the following line:
>
> [~,a] = ismember(b,c,'rows');
>
> I get an error on this line in Matlab 2007b when i run the code , the
> error is :
> "Expression or statement is incorrect--possibly unbalanced (, {, or [ "
>
> However, no such error issue when I run the exact script in Matlab 2010a.
>
> Please, can anyone share as to why this is so?

Because the script uses a feature that was introduced in release R2009b and
so will not work in previous releases.

http://www.mathworks.com/help/techdoc/rn/br5fo8o-1.html#br65zmd-1

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Matlab 2007b_Matlab 2010a question

From: Vandita

Date: 3 Apr, 2014 07:12:09

Message: 4 of 6

Dear Sir, Thanks for your reply. If you let us know how to sort this out for versions 2009a and older versions, that will be a great help as I am also receiving same error at many places. Thanks and Regards.

Subject: Matlab 2007b_Matlab 2010a question

From: Vandita

Date: 3 Apr, 2014 07:13:09

Message: 5 of 6

Dear Sir, Thanks for your reply. If you let us know how to sort this out for versions 2009a and older versions, that will be a great help as I am also receiving same error at many places. Thanks and Regards.

Subject: Matlab 2007b_Matlab 2010a question

From: Steven Lord

Date: 3 Apr, 2014 13:45:38

Message: 6 of 6


"Vandita " <vandita@iirs.gov.in> wrote in message
news:lhj1k9$356$1@newscl01ah.mathworks.com...
> Dear Sir, Thanks for your reply. If you let us know how to sort this out
> for versions 2009a and older versions, that will be a great help as I am
> also receiving same error at many places. Thanks and Regards.

*original question from three years ago was about [~, a] = ismember(...) not
working on releases prior to the introduction of this tilde syntax*

Don't use tilde in this way. See the first item in the Programming section
of the Release Notes for R2009a.

http://www.mathworks.com/help/releases/R2014a/matlab/release-notes-older.html#R2009b

You will need to use the "[val1, ignoreThisOutput, val3] = myTestFun;"
syntax not the "[val1, ~, val3] = myTestFun;" syntax.

Or you could upgrade your version of MATLAB.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for 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