How can I use variables in mkdir?

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일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Variables에 대해 자세히 알아보기

질문:

2013년 8월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by