How to use .name?

67 visualizzazioni (ultimi 30 giorni)
Fahad Obaid
Fahad Obaid il 15 Ott 2018
Modificato: Stephen23 il 16 Ott 2018
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 Commenti
Fahad Obaid
Fahad Obaid il 16 Ott 2018
Modificato: Fahad Obaid il 16 Ott 2018
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 il 16 Ott 2018
Modificato: Stephen23 il 16 Ott 2018
"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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by