find a mean of values in a field of a struct
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
elisa ewin
il 22 Mag 2017
Modificato: Andrei Bobrov
il 22 Mag 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
0 Commenti
Risposta accettata
Andrei Bobrov
il 22 Mag 2017
Modificato: Andrei Bobrov
il 22 Mag 2017
for ii = 1:numel(userTouristicTraj)
if ~isempty(userTouristicTraj(ii).pauseTime)
userTouristicTraj(ii).pauseTime(1).pt_mean = ...
mean([userTouristicTraj(ii).pauseTime.pt]);
end
end
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Structures in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!