str2varn converts any string to required variable name FINAL VERSION OF STR2VARR, STR2VRRS commands = 'reza(:,:) rezas(1,23) redf (:,5) reft(3,:) me(12,:)'' mftr(1:23,34:567)'''; commands='timefunc porar(35,:)''' commands='timefunc porar(35,:)'' stresselez(12,:)'' timefunc' commands = 'C31limitele (:,:)''*(-1) Ck0telem (:,:)''*(-1)' str2varn('timefunc porar(grpoint,:)''') str2varn('timefunc') str2varn('timefunc porar(grpoint:40,:)''') str2varn('timefunc porar(drt:grt,:)''') str2varn('timefunc(A:B,1:D) porar(drt:grt,:)''') str2varn ('timefunc porar(grpoint,:)''') str2varn('GOtelem(:,1:10)') str2varn(commands) commandsss = str2varn(commands) See also, STR2VARR, STR2VRRS