Add a variable within single quotes
Ältere Kommentare anzeigen
XLfile = dir('*.csv'); %List contents of the current folder
[~, index] = sort(str2double(regexp({XLfile.name},'\d+','match','once')));
XLfile = XLfile(index);
filename = {XLfile.name};
for k1=1:Num_of_files;
figure
plot(x{1,k1}, y{1,k1})
savefig('filename{1,k1}.fig');
fig = openfig('filename{1,k1}.fig');
end
Hello everyone,
I am wondering how I insert a variable inside single quotes.
Apparantly, the codes above (not complete codes. I just included essential parts) will not work. But I want to save figures with the n-th filename with extension of fig.
Thank you.
4 Kommentare
madhan ravi
am 23 Jan. 2019
Illustrate with an example of a string and tell exactly at which location the variable have to be inserted!
Cheeesepondue
am 23 Jan. 2019
Cheeesepondue
am 24 Jan. 2019
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Just for fun finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!