MATLAB Answers

Save a string consisting of data to another directory

1 view (last 30 days)
FG
FG on 23 Sep 2020
Commented: FG on 23 Sep 2020
I want to save a string consisting data to another directory..
c = sprintf('Power Factor=%.2f, PL=%g, FG=%g, Angle=%g, Nt=%g.mat', QM1, PL, FG, Ang_A, Nt);
How can I save c to the D:\Sim Results directory ?

  0 Comments

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 23 Sep 2020
Edited: Ameer Hamza on 23 Sep 2020
f = fopen('D:\Sim Results\filename.txt')
fprintf(f, 'Power Factor=%.2f, PL=%g, FG=%g, Angle=%g, Nt=%g.mat', QM1, PL, FG, Ang_A, Nt);
fclose(f);

More Answers (0)

Tags

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!