Effacer les filtres
Effacer les filtres

find a mean of values in a field of a struct

2 vues (au cours des 30 derniers jours)
elisa ewin
elisa ewin le 22 Mai 2017
Modifié(e) : Andrei Bobrov le 22 Mai 2017
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

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 22 Mai 2017
Modifié(e) : Andrei Bobrov le 22 Mai 2017
for ii = 1:numel(userTouristicTraj)
if ~isempty(userTouristicTraj(ii).pauseTime)
userTouristicTraj(ii).pauseTime(1).pt_mean = ...
mean([userTouristicTraj(ii).pauseTime.pt]);
end
end

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by