How to use .name?

조회 수: 10 (최근 30일)
Fahad Obaid
Fahad Obaid 2018년 10월 15일
편집: Stephen23 2018년 10월 16일
What does it mean when I write this line PicName = CylinderFile(1).name
It is extracting the picture/figure of the cylinder. when I run it, it says Index exceeds array bounds. for this line.
  댓글 수: 3
Fahad Obaid
Fahad Obaid 2018년 10월 16일
편집: Fahad Obaid 2018년 10월 16일
Thank you. You were right the structure returned by dir, and my question now about the parentheses it has 1 as a value. Should it have a name of the folder instead.
Stephen23
Stephen23 2018년 10월 16일
편집: Stephen23 2018년 10월 16일
"You were right the structure returned by dir, and my question now about the parentheses it has 1 as a value. Should it have a name of the folder instead."
The structure returned by dir can be accessed using indexing, so what your code does is perfectly valud code: it accesses the first element of that structure. If there are no elements, then you will need to figure out why dir did not match anything.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by