Current location - Loan Platform Complete Network - Big data management - matlab how to write a cell to a text file?
matlab how to write a cell to a text file?
First use the load function to read out the contents of several txt files and store them in a temporary variable, then use the fprintf function to write the values in the temporary variable to another txt file in the expected order.

Specifically, you can refer to the following program segment:

A = load('a.txt'); % File a is the data file 1

B = load('b.txt'); % File c is the data file 2

fid=fopen('c.txt', 'w'); % File c is the file with the integrated data < /p>

fprintf(fid,'%s', A); % Write data from file a to file c

fprintf(fid,'%s', B); % Write data from file b to file c

fclose(fid);