Accessing the output individually
2 ビュー (過去 30 日間)
古いコメントを表示
Dear All, could you please tell me, how can i access each element of the output result? for example, to get 16.6056 as output.
Thank you in advance.
>> logfile_P(1,1:25).time
ans =
16.6056
ans =
21.7406
ans =
26.8590
ans =
32.0106
ans =
37.1623
ans =
57.7857
ans =
62.9207
ans =
68.0890
ans =
73.2240
ans =
78.3590
ans =
140.1291
ans =
145.2807
ans =
150.4324
ans =
155.5674
ans =
160.7024
ans =
181.3091
ans =
186.4441
ans =
191.5958
ans =
196.7308
ans =
201.8825
ans =
263.6858
ans =
268.8042
ans =
273.9392
ans =
279.0575
ans =
284.1925
>> logfile_P
logfile_P =
1x50 struct array with fields:
trial
event_type
code
time
ttime
uncertainty
duration
uncertainty_1
reqtime
reqdur
stim_type
pair_index
1 件のコメント
Stephen23
2015 年 6 月 30 日
If you only want one element (e.g. 16.6056 as stated in the question), then just index into the structure:
logfile_P(1).time
採用された回答
Sid
2015 年 6 月 30 日
Perhaps try timeValues = [logfile_P.time] to make a vector and then extract timeValues(1:25) ?
0 件のコメント
その他の回答 (1 件)
Sid
2015 年 6 月 30 日
編集済み: Sid
2015 年 6 月 30 日
This is beyond the scope of the original question, but you could also try struct2table (read here .) to complete the structure to a table data format.
Again, simply an alternative option, but thought I put a note in case someone finds it useful.
HTH.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!