TheAlgorithms / MATLAB-Octave

This repository contains algorithms written in MATLAB/Octave. Developing algorithms in the MATLAB environment empowers you to explore and refine ideas, and enables you test and verify your algorithm.
MIT License
364 stars 173 forks source link

Fix random search #78

Closed MaximSmolskiy closed 3 years ago

MaximSmolskiy commented 3 years ago

Current random search implementation doesn't run. In Octave:

>> random_search

error: parse error near line 19 of file D:\MATLAB-Octave\algorithms\Searching\random_search.m

  syntax error

>>>     best,=min(feval(ObjFun,candidate));

In MATLAB:

>> random_search
Error: File: random_search.m Line: 19 Column: 10
Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values
for equality, use '=='.

It has syntax error - redundant comma , in line 19:

best,=min(feval(ObjFun,candidate));