How to convert .txt to matlab file that I can use "load"

Hi, everyone.

I want to load new “.txt” file to run it but I do no know how to do it. I have created the “.txt” file (by converting excel into txt) and now I should convert this “.txt” into matlab file in order to be able to load it. (because when I run it directly as normal .txt., it gives the error which says that my txt file is not found).

Thanks

I do not understand. What do you want to run? Please provide the file.

https://drive.google.com/drive/folders/1IC9jXRoU2GnNqRrrTRrXXofnnk37OHUz
you can download the .m files here. You should run them sequentially:

  1. trivar
  2. olsvarc
  3. irfvar
  4. stage2irf
  5. dif
  6. vec.
    First of all, if you open the trivar.m you will see that there is “data.txt” in the line 16. I want to replace this file with “my.data.txt”, which is normal txt file but not “.m” file. Hence, I cannot run it, as I told it is not the matlab file. How can I solve it?

Sorry, but I still don’t understand. data.txt is ASCII data. It’s just numbers, not executable code. The code part

load data.txt; y=data; [t,q]=size(y); 
time=(1973+2/12:1/12:2007+12/12)';

is what loads the data and constructs a timeline

First of all, I did not change anything. I have sent you official codes by prof Lutz Kilian. They are his codes of his paper. Now, my question is that how can I load “my.data.txt” in stead of “data.txt”? It does not work by simply erasing the “data.txt” and writing “my.data.txt”. Please, just try it and you will see the error.

Given you strange naming with a second dot in the filename, you need

data=load('my.data.txt'); y=data;