필터 지우기
필터 지우기

How to transfer data from a structure field to a new array?

조회 수: 1 (최근 30일)
Jasmine Karim
Jasmine Karim 2018년 7월 17일
답변: Walter Roberson 2018년 7월 17일
Hi all,
This is likely an extremely easy fix, but I'm new to this and am not entirely sure how to work with a structure. I have a structure with 4 fields (i.e., XY.event.typ XY.event.lat XY.event.epo XY.event.uev). I want to pull the values from the second field (EEG.event.lat) and put them into an existing matrix elsewhere in the code. Right now I can't even seem to pull all the rows from one of the field columns. How can I do this?
Thank you
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 7월 17일
Is XY a scalar structure? Is XY.event a scalar structure?
Jasmine Karim
Jasmine Karim 2018년 7월 17일
XY is scalar. XY.event is not.

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

답변 (1개)

Walter Roberson
Walter Roberson 2018년 7월 17일
vertcat(XY.event.lat)
is equivalent to taking
[XY.event(1).lat;
XY.event(2).lat;
XY.event(3).lat;
...
XY.event(end).lat]

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by