Black hole variable MATLAB

Does MATLAB have a black hole or discard variable?

Say I'm doing something like:

[ rows cols ] = size( A ) ; 

But I do not want the rows to be saved. Is there a black hole variable where I can send values ​​to die?

So the appointment will be like

 [ BLACKHOLE, cols ] = size( A ) ; 

Where BLACKHOLE means to throw away the value and not create a variable for it.

+8
syntax matlab
source share
2 answers

During 2009b or later there is a tilde sign "~"

 [~,cols] = size(A); 

Alternatively, in your particular case

 cols = size(A,2); 
+12
source share

For compatibility with Matlab versions prior to 2009b, you can use the following technique

[cols, cols] = size (A);

See http://blogs.mathworks.com/steve/2010/01/11/about-the-unused-argument-syntax-in-r2009b/ , for example

+1
source share

All Articles