arrays - Manipulating a struct which is a class property in MATLAB -
i've been trying work matlab classes & structs in order develop traffic simulation. have not worked actively matlab classes before, gets bit tricky @ times. questions involves manipulating struct, property of class. top-level access vehicles_handle = vehicleshandle; vehicles_handle.createvehicles(initialtrafficdensity); vehicles_handle.vehicles(1) class definition classdef vehicleshandle %vehicleshandle summary of class goes here % detailed explanation goes here properties active_vehicles_count vehicles end methods (access = public) function obj = vehicleshandle obj.active_vehicles_count = 0; obj.vehicles = struct('lane',0,'position',0,'velocity',0); end function obj = createvehicles(obj,initialtrafficdensity) obj.active_vehicles_count = obj.active_vehicles_count + 1; obj.vehicles(1).lane = 1; obj.vehicles(1).position ...