defining the position of input file

1 visualizzazione (ultimi 30 giorni)
Osman mamun
Osman mamun il 18 Apr 2014
Risposto: Star Strider il 18 Apr 2014
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

Risposte (2)

dpb
dpb il 18 Apr 2014

Star Strider
Star Strider il 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.

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by