필터 지우기
필터 지우기

how to use arrayfun

조회 수: 8 (최근 30일)
Luca Re
Luca Re 2023년 12월 18일
답변: Voss 2023년 12월 19일
Eq.Data is a struct with 2 fields
data is 5864x1 datetime
R1 is 1x27 double
i want to create the follow array:
TradeF(1)=Eq.Data(738) (because r1(1) = 738 )
TradeF(2)=Eq.Data(734) (because r1(2) = 734 )
...
i try to use arrayfun but i but not so use it correctly
T.TradeF=arrayfun(@(s,i)s.data(i),Eq,r1)';
i receive this error:
Error using arrayfun
All of the input arguments must be of the same size and shape.
Previous inputs had size 1 in dimension 2. Input #3 has size 27
  댓글 수: 1
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 12월 19일
Your question is NOT clear. Please reformulate it.

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

채택된 답변

Voss
Voss 2023년 12월 19일
TradeF = Eq.data(r1);

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by