if i make a conditional statement where i compare 2 stings, i need to do this:
if strcmpi(string_1,string_2), ... end
but the following looks much more elegant, and readable:
if string_1 == string_2 ... end
that is why i wrote the function
function y = eq(a,b) y=strcmpi(a,b); end
but this only works when i put the string in a cell like this:
if {string_1} == {string_2} ... end
does anyone know why/ how to overrule the built-inn? also, why does an anonymous function ( eq=@(a,b)strcmpi(a,b); ) not work?
Best Answer