필터 지우기
필터 지우기

find a mean of values in a field of a struct

조회 수: 2 (최근 30일)
elisa ewin
elisa ewin 2017년 5월 22일
편집: Andrei Bobrov 2017년 5월 22일
Hi,
I have a struct (attached) and I want to find the mean for userTouristicTraj(i).pauseTime.pt i = 1:size(userTouristicTraj,2) and I want to save it in userTouristicTraj(i).pauseTime.pt_mean: can you help me? thanks

채택된 답변

Andrei Bobrov
Andrei Bobrov 2017년 5월 22일
편집: Andrei Bobrov 2017년 5월 22일
for ii = 1:numel(userTouristicTraj)
if ~isempty(userTouristicTraj(ii).pauseTime)
userTouristicTraj(ii).pauseTime(1).pt_mean = ...
mean([userTouristicTraj(ii).pauseTime.pt]);
end
end

추가 답변 (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