MATLAB: How to csvwrite an array in HDFS

csvwritehadoophdfsMATLABspark

Hi,
I have Matlab connected to a Hadoop cluster. I want to save an array as a csv file to HDFS. The only commend I found was:
location = 'hdfs://master/user/savecsvfile';
write(location, Array1 );
Then I check the HDFS respiratory to find a file "part-1-snapshot.seq" and the contents are different from what Array1 is.
Thanks,

Best Answer

write command is able to write only tall array as .seq file. So, if you want to save csv files to HDFS, you should first save csv files on locla then upload to HDFS using Hadoop commands. From MATLAB,
csvwrite('hoge.csv', Array1);
!hadoop fs -copyFromLocal ./hoge.csv /user/savecsvfile