Re: [問題] 結構陣列要如何看?已回收
※ 引述《yimean (溫柔殺手N  )》之銘言:
: 各位版眾晚安。
: 我在command windows下 a=dir
: 她會跑出a是struct陣列
: 我怎麼樣才能觀看a的內容呢?
: 還有我在M檔中下a=dir他都不鳥我!
: 這是為什麼呢?
: 煩請版眾幫忙解答!感謝!
先打a=dir後會出現這些
某數字x1 struct array with fields:
name
date
bytes
isdir
datenum
而根據help裡的關於fields的敘述
name -- filename
date -- modification date
bytes -- number of bytes allocated to the file
isdir -- 1 if name is a directory and 0 if not
datenum -- modification date as a MATLAB serial date number
所以如果你想要看這裡面第一個檔案的檔名的話
使用a(1).name就好了
同理想要看第三個檔案的大小的話
使用a(3).bytes即可
--
Deserves death! I daresay he does. Many that live deserve death. And some die
that deserve life. Can you give that to them? Then be not too eager to deal out
death in the name of justice, fearing for your own safty. Even the wise cannot
see all ends.
Gandalf to Frodo
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.233.246.48
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章