How can I save the information generate in the script below which include strings and table in the following format to a text file?
Format:
M=5
1 21
2 22
3 23
4 24
5 25
5points
Script:
clc;
clear all;
close all;
ElmentsNum = "EM=5";
x = (1:5)';
y =(21:25)';
t = table(x,y);
M = "5points"
fileID = fopen('E:/Data.txt');
fprintf(fileID,'%s/n',ElmentsNum)
fprintf(fileID,'%.4f',t)
fprintf(fileID,'%s/n',M)
fclose(fileID)