In doing research,We often need output the result to the file and read from the file.In this note, I will summarize the methods of reading and output method in MATLAB.
We first consider the method of saving and read the MATLAB type file. The Matrix in MATLAB can be directly saved in a “xx.mat” file. This method can save many different result in an whole single file. I really recommend this method. This can be done as follows:
to read the file,
the mat file can only be opened in MATLAB, In order to allow other software to open the output file. We can save the file as txt or csv file. This can be done via csvread/cavwrite, textread/textwrite,dlmwrite/dlmread,And I recommend the dlm method
% read csv file via "csvread"
this can be done via fopen and fprintf method
to save the figure in the window,the best way is to use print.