필터 지우기
필터 지우기

x=dir('c:\mydir') ; x(1).name = '49' ??? weird output bug

조회 수: 1 (최근 30일)
Rory
Rory 2011년 12월 4일
Hi all
I was using the dir function to get a list of the subdirectories in a folder. Everything looks correct when I view the values of the output structure. However, when I want to assign the name values into a string array (to be used later as a loop indexer) the string values of the names that are assigned to my string array elements are all '49' ! This seems like something is not going right... I have tried using explicit loops and using : notation to assign the values but neither way works right.
Thanks in advance
  댓글 수: 2
Sven
Sven 2011년 12월 5일
Can you show code beyond what's in the title of this post?
The code there indicates that you are *setting* the first element of the structure "x" to be the string '49'. Is this what you intended? Your question seems to be about doing something with a string array (rather than the structure output of "dir"), so it's a little unclear.
Jan
Jan 2011년 12월 5일
Without seeing the code, we cannot guess, what's going wrong.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by