thank you, I was used the matlab function block (in simulink) for my simulation but did not give the desired answers, my problem is how to run the simulation, simulink? m.file or ....?
It depends on your complete MatLab/Simulink model: if your Simulink scheme contains all the variables that you need in the simulation, you can run it just using Simulink. Otherwise you should create a .m file calling the simulink model (by using the "sim" function). And you should also be sure to export from Simulink to the MatLab workspace all the variables you need to process or analize: you can make this by using the "To Workspace" Simulink block.
In the MatLab help you can find some example that can make you well understand how the Simulink/MatLab simulation works.