필터 지우기
필터 지우기

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 CenterFile Exchange에서 Power Converters에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by