Can someone explain why this doesn't work?
vec_1=[1 2 3 4];vec_2=[5 6 7 8];vec_3=[9 10 11 12];vec_4=[13 14 15 16];arrayfun(@(x)eval(sprintf('vec_%d',x)),1:4)??? Error using ==> evalUndefined function or variable'vec_1'.Error in ==>@(x)eval(sprintf('vec_%d',x))
I'm just curious about this strange behavior, it says that vec_1 isn't defined but it is!
Thank you in advance
PS: This is related to http://www.mathworks.com/matlabcentral/newsreader/view_thread/303123 but I didn't get a reply, just a comment from someone acting like a douchebag.
Best Answer