What does a tilde (~) inside square brackets mean?
Show older comments
[~, Palette] = kmeans(reshape(B(:),M*N,3),8,'E','s','S','U');
Specifically, what does the ~ inside the square brackets represent (e.g. a matrix with multiple LHS assignment)?
Accepted Answer
More Answers (2)
Walter Roberson
on 18 Apr 2013
It is equivalent to
[temp, Palette] = kmeans(reshape(B(:),M*N,3),8,'E','s','S','U');
clear temp
2 Comments
Delvin
on 18 Apr 2013
Walter Roberson
on 9 May 2019
[ThIsVArIAblEiZnOTuzED, Palette] = kmeans(reshape(B(:),M*N,3),8,'E','s','S','U');
clear ThIsVArIAblEiZnOTuzED
and the [] mean that multiple outputs are being returned from the function. It is not an array.
Ankur Bhardwaj
on 24 May 2017
0 votes
Whether it is supported in Matlab Version 2009 or not.
1 Comment
Steven Lord
on 24 May 2017
This functionality was introduced in release R2009b. So it depends what you mean by "Version 2009" -- release R2009a no, release R2009b yes.
Categories
Find more on Call Python from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!