Save disp to a text file

6 visualizzazioni (ultimi 30 giorni)
Zayd Islam
Zayd Islam il 23 Mar 2021
Risposto: Fangjun Jiang il 23 Mar 2021
I want a text file with its name to be DailySummary and i want it to save these disp outputs in it. how should i do it?
disp(strcat('Day',{' '},num2str(data(i).elapsedtime(3)),{' '},' Healthy People = ',{' '},num2str(data(i).healthy)))
disp(strcat('Day',{' '},num2str(data(i).elapsedtime(3)),{' '},' Infected People = ',{' '},num2str(data(i).infected)))
disp(strcat('Day',{' '},num2str(data(i).elapsedtime(3)),{' '},' Sick People = ',{' '},num2str(data(i).sick)))
disp(strcat('Day',{' '},num2str(data(i).elapsedtime(3)),{' '},' Recovered People = ',{' '},num2str(data(i).recovered)))

Risposte (1)

Fangjun Jiang
Fangjun Jiang il 23 Mar 2021
help diary

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by