defining the position of input file

I have written a code that reads from a .dat file and does some calculation and stores the results in another .dat file. Every time i have to manually edit the position of file. Now is it possible to do it in a loop? Like load('D:\mamun\research\rateconstant\K1\freq.dat'), now when i will run the program everything will remain same only K1 will change to K2, k3 and so on. Is it possible to run it in a loop? or is it possible, it will ask me to give that position? Thanks

Answers (2)

Star Strider
Star Strider on 18 Apr 2014
The ftell and fseek functions might do what you want. I haven’t used these recently, but you would get the output of ftell and store it, and use fseek to return to where you were.

Categories

Tags

No tags entered yet.

Asked:

on 18 Apr 2014

Answered:

on 18 Apr 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!