Let me see if I interpret the question correctly: you have
filename = 'bob';
data = [1,2,3];
And you want to rename data to bob (the contents of filename)?
Firstly, be careful doing things like this. It makes it very hard to track names. But, if you must...
str = [filename,'= data;'];