Save disp to a text file

9 Ansichten (letzte 30 Tage)
Zayd Islam
Zayd Islam am 23 Mär. 2021
Beantwortet: Fangjun Jiang am 23 Mär. 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)))

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 23 Mär. 2021
help diary

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by