Made a small script in which we pick 2 random numeric elements from the "box" (array with "0"s and "1"s). I want to make further steps depending on the sum of these elements, however Matlab doesn't execute the script with the following mistake (see the screenshot). Script proceeds with ">" and "<", but not "="

 Respuesta aceptada

Sean de Wolski
Sean de Wolski el 1 de Jun. de 2016

1 voto

one = is an assignment, two = is a test of equality
if sum(x) == 1
will fix this.

1 comentario

Vasilyi Troshkin
Vasilyi Troshkin el 1 de Jun. de 2016
thx, did this the 2d time and it worked I tried this before but somehow it didn't help

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by