MATLAB: How to export this file i downloaded to a separate file on the desktop

fwritesavewriteyahoo finance

I've just started using Matlab and was wondering if someone could help me with finishing up this code.
Basically I am trying to download a file from yahoo finance and export it to a file. How do I create a saved file containing my downloaded data in an output folder which is in C:\Users\Desktop\ It's something with the fwrite function, but i can't figure it out. Thanks a lot,
thisurl = strcat('', thissym, '&d=10&e=8&f=2011&g=d&a=0&b=1&c=2000&ignore=.csv')
thisfilename = strcat(thissym, '.csv')
thisfileid=fopen(thisfilename, 'w')
fwrite(thisfileid, thisdata)

Best Answer

  • thisfileid=fopen(thisfilename, 'wt')
    fprintf(thisfileid, '%s\n',thisdata)