From: jacob lalaounis on
Hello,
i would like to create a folder with the input name that i give from the keyboard
but the code creates myfilename folder.

'Give the name of the folder'
myfilename=input('Input the filename:','s');
fprintf('You have requested file: %s\n', myfilename)
mkdir('C:\myfilename');

thanks in advance

jacob
From: dpb on
jacob lalaounis wrote:
> Hello,
> i would like to create a folder with the input name that i give from the
> keyboard
> but the code creates myfilename folder.
> 'Give the name of the folder'
> myfilename=input('Input the filename:','s'); fprintf('You have requested
> file: %s\n', myfilename)
> mkdir('C:\myfilename');

Yes, it did exactly what you told it to... :)

'C:\myfilename' is a literal character string. You want something like

mydirname = ['C:\' myfilename];
mkdir(mydirname);

--