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 "="

 Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 1 Jun. 2016

1 Stimme

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

1 Kommentar

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by