How to change a given name
    3 views (last 30 days)
  
       Show older comments
    
Hi, 
An easy question but I can not find the solution. I have a number which is changing but i want to change it by myself.
How can I use that one in my folder name like this:
Thanks in advance
%% test
num = '0000060'
folder = 'C:\Users\dit\Documents\MATLAB\RawData\'+ num +'.csv';
0 Comments
Accepted Answer
More Answers (1)
  Jan
      
      
 on 9 Feb 2021
        num    = '0000060'
folder = ['C:\Users\dit\Documents\MATLAB\RawData\', num, '.csv'];
% Or with strings instead of char vectors:
folder = "C:\Users\dit\Documents\MATLAB\RawData\" + num + ".csv";
% Or:
num = 60
folder = fullfile('C:\Users\dit\Documents\MATLAB\RawData\', ...
    sprintf('%07d.csv', num))
See Also
Categories
				Find more on Title 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!


