Hi again, I've made some improvement:
classdef tsGenerate < timeseries
properties
channel
end
methods
function channel_obj = tsGenerate(dataVector,timeVector,name,nameStr,Channel)
channel_obj = channel_obj@timeseries(dataVector,timeVector,name,nameStr);
if nargin > 0
channel_obj.channel = Channel;
end
end
function dataPlot(channel_obj)
plot(channel_obj.Data)
end
end
end
I can read the Standard Units using (my data is stored in Standard Units):
>>speed.channel.Quantity.SIunit.ms (meter per seconds)
and also different units using:
>> speed.channel.Quantity.otherUnits.kph
Now what I need is to create a method that plot my data stored into:
>> speed.Data
but I also want to have the possibility to plot my data using otherUnits.
I have a class called otherUnits that store also the conversion constant to convert data from meter per seconds to kph. So it's available from:
>> speed.channel.Quantity.otherUnits.kph.conversionConstant
How to create a method with sort of "submethods" to plot my data using differents units?
For example, if I want to plot my data in standard units I would use:
>> speed.dataPlot.SIunit.ms
and if I want to plot my data in other units I would use:
>> speed.dataPlot.otherUnit.kph
Thanks guys,