I have created a .m file like this:
function M
clc
clear
T=[
1 2 3
4 5 6
7 8 9
];
surface (T)
shading interp
end
ALL I want is this: when click on that m-file(I mean when m-file opens), matlab RUN it. so there will be no need for user to click on RUN.
EDIT: I want script run when opening m-file I need this because I've created this M file at the end of a C# program, and C# program opens m-file just to shows the graph. so it is better that after opening it, run automatically and shows the graph. (so user easily see graph and there is no need to run it.) I thought there maybe an easy way , such as writing a code in m-file which makes it run right after opening.