フィルターのクリア

How can I use variables in mkdir?

7 ビュー (過去 30 日間)
Tina
Tina 2013 年 8 月 8 日
Hello;
Let's say I have four different variables (a, b, c, d) and I want to create folders using these variables as the name of my folder (folder name= a.b.c.d) How can I do this using mkdir?
Thanks, Tina

採用された回答

Friedrich
Friedrich 2013 年 8 月 8 日
Hi,
what about
a = 'hello'
b = 'world'
c = 12
d = 'xxx'
mkdir([a,'.',b,'.',num2str(c),'.',d])
  2 件のコメント
Tina
Tina 2013 年 8 月 8 日
This works, but I dont know why for example mkdir([a,'.',b]) doesn't work
Jan
Jan 2013 年 8 月 8 日
編集済み: Jan 2013 年 8 月 8 日
What does "doesn't work" mean? What happens instead? What is the type and the valuer of your variables a and b? The original question is not clear in this point.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePower Converters についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by