How to save ans workspace of a Function
8 views (last 30 days)
Show older comments
Mohamed Gamal
on 29 Jul 2018
Answered: Mohamed Gamal
on 31 Jul 2018
Dear All, I have A function that reads a file, when I use it it succeed to read the file but it put it in a workspace with the name "ans".
Can I save this to output txt file ??
Accepted Answer
Walter Roberson
on 29 Jul 2018
output = NameOfYourFunction(whatever, arguments, are, appropriate, go, here);
save('NameOfOutputFile.txt', 'output', '-ascii', '-double');
0 Comments
More Answers (1)
See Also
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!