How to create a directory using mobile number of a particular username..
古いコメントを表示
I need how to create a directory with the name of user's mobile number. suppose the user mobile number is 8511356595. the same number must be a foldername of that user to differentiate the next user. when I'm getting this mobile number from the database it is displaying like this [8.5114e+09]. When I create a folder using mkdir command, asking argument must be a string... Please help me.....
回答 (2 件)
Well, obviously, you need to convert the number to a string, which can be done with any of the many functions that do it:
foldername = sprintf('%d', mobilenumber);
or
foldername = num2str(mobilenumber);
or
foldername = compose('%d', mobilenumber);
Also, read about the format command which changes how the numbers are displayed in the command window only, not how they're stored.
1 件のコメント
Maruthi Maruthi
2017 年 3 月 31 日
num = 8511356595 ;
format long g ; % this is optional
fname = num2str(num) ;
mkdir(fname)
2 件のコメント
Maruthi Maruthi
2017 年 3 月 31 日
KSSV
2017 年 3 月 31 日
The code which I gave it should work...Show what you tried?
カテゴリ
ヘルプ センター および File Exchange で Search Path についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!