0

I am trying to run a regression on a CSV file that is pulled from online. However, based on the code below, the CSV file isnt being pulled every time the loop runs and the regression is happening on the same CSV data downloaded. help.

Thanks,

CODE EXHIBIT A:

while true

csvimport1();

assert(length(_A) == length(VariableA));
assert(length(_A) == length(VariableB));
_A = transpose(_A);

MainA = _A(length(_A)-751:length(_A));


tic
[REGRESSION FUNCTION HERE]
toc

end

CODE EXHIBIT FOR CSV PULL: CSVIMPORT1

url = 'http://www[dot]websitehere[dot]com/total.csv';

delimiter = ',';
fileID = urlread(url);

dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'EmptyValue' ,NaN, 'ReturnOnError', false);

fclose all;

VariableA = dataArray{:, 1};
VariableB = dataArray{:, 2};
VariablesC = dataArray{:, 3};

clearvars filename delimiter formatSpec fileID dataArray ans;
mmk88
  • 91
  • 1
  • 6
  • Please provide a functional example that reproduces your issue and what you used to come to the conclusion that the CSV file is not being pulled every time and the same CSV file is being run. Are you updating `url` with every loop iteration? – sco1 Nov 25 '15 at 01:44

1 Answers1

0

This actually works fine. I was referencing the wrong URL. Sorry and Thank you!

mmk88
  • 91
  • 1
  • 6