How to save a txt file in matlab with the specified name I want?
    4 views (last 30 days)
  
       Show older comments
    
Example:
filename = input('Enter the file name: ','s')
A
save(fullfile('directory path','filename.txt'),'A','-ascii')
0 Comments
Accepted Answer
  Walter Roberson
      
      
 on 14 Apr 2021
        fullname = fullfile('directory path', [filename '.txt']);
save(fullname, 'A', '-ascii')
More Answers (0)
See Also
Categories
				Find more on Files and Folders 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!
