MATLAB: Help on ‘str’ yield help on ‘std’

r2016busing help

Hi all,
When I want to check if a name for a new variable I want to use is already part of Matlab language I just seek help on that word (hopping to get 'word' not found). I guess this is a common practice.
I tried to use this technique with the word 'Str' (short name for a string) and got help on the known function 'std'. Either it is a bug or part of Matlab attempt to guess typos. In both cases, it doesn't help…
Is it a typo correction? Is it a bug?

Best Answer

  • Don't use help to check if a name is already used: the best function for this is which:
    which str
    which str -all
    For example:
    >> which str
    'str' not found.
    >> which std
    C:\Program Files\MATLAB\R2010b\toolbox\matlab\datafun\std.m