Suppose we have expressions like u1=1/24*h*sin(3*t)-1/24*h*sin(3*t)*k+1/24*h*sin(t)-1/24*h*k*sin(t). After saving it in a .mat file how can we load it into matlab.I am new user of matlab. We are using symbolic toolbox of matlab version 5.3.After using char command we can save our expression in mat file or in other files too.For example, fid=fopen('out.mat','r'); syms t k class(t); u0=sin(t)+k*cos(t)^2; u0=char(u0); fprintf(fid,'u0=%s',u0); fclose(fid);
This will save u0 in the file out.mat or whatever the name chosen, in my best of knowledge.If you have any better option,then please tell me. So,now my question is how to load it or how will we use this expression in other files. Sorry for not giving full information about the problem.I have tried the command load filename,but it gives "file can not be open".I don't know.Why?