Question

What does the tilde symbol ~ do in Matlab?

for example, I've got the Matlab line, in which a and b are tables.

a =~b;
Was it helpful?

Solution

Basically a is assigned to the result of the logical not operator applied to b

For example if b is the matrix

b = [12 0 10]

then

a = ~b 
a = [0 1 0]

See http://www.mathworks.co.uk/help/matlab/ref/not.html for details

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top