matlab - The function sqrt() without parentheses returns weird value -
i've accidentally typed following in octave:
sqrt 25
and got back:
ans = 7.0711 7.2801
with parentheses, sqrt(25)
returns correct result. happening without parentheses? matlab share same behaviour or specific octave? don't have matlab cannot check.
octave interpreting length-2 char array, , converting these ascii representation (50 , 53), getting square root. can done in matlab using:
sqrt(double('25'))
matlab produces error sqrt
isn't defined char inputs when used without parentheses.
Comments
Post a Comment