I found the Answer
using matlabFunction. It takes a longer time to generate a file but,after that things will be faster. And as long as I want to substitute in the for loop so this one is incredibly faster. It took 0.0008 sec
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!