From bc61b5b9265bde0f30dfc53db0bf5820e3c69b04 Mon Sep 17 00:00:00 2001 From: Mauco03 <marco.gaibotti@skywarder.eu> Date: Wed, 26 Mar 2025 22:53:29 +0100 Subject: [PATCH] [handle-value-conversion] Added updateAll method --- classes/misc/Wind.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/classes/misc/Wind.m b/classes/misc/Wind.m index e8aa811..f3eb9a9 100644 --- a/classes/misc/Wind.m +++ b/classes/misc/Wind.m @@ -123,6 +123,16 @@ classdef Wind < Config obj@Config(mission, varIn); end + function obj = updateAll(obj) + obj.magnitude = obj.updateDistribution(obj.MAGNITUDE_DISTRIBUTION, obj.MAGNITUDE_PARAMETERS); + obj.azimuth = obj.updateDistribution(obj.AZIMUTH_DISTRIBUTION, obj.AZIMUTH_PARAMETERS); + obj.elevation = obj.updateDistribution(obj.ELEVATION_DISTRIBUTION, obj.ELEVATION_PARAMETERS); + + obj.checks(1) = length(obj.magnitude) == length(obj.ALTITUDES); + obj.checks(2) = length(obj.azimuth) == length(obj.ALTITUDES); + obj.checks(3) = length(obj.elevation) == length(obj.ALTITUDES); + end + function [uw, vw, ww] = getVels(obj, z) if ~all(obj.checks) error(['Parameters and distributions must be the same ' ... -- GitLab