i put the following code i got the error of "Unrecognized method, property, or field 'velocity' for class 'timeseries''.

20 ビュー (過去 30 日間)
Farman Ullah
Farman Ullah 2020 年 1 月 2 日
回答済み: Max Murphy 2020 年 1 月 2 日
can somebody help me
for j=1:length(concept)
P_sec_users=0;
for kk = 1:length(driving_cycles_loading.mat)
filename = driving_cycles_loading.mat{kk};
current_cycle = load(['cycledata','/',filename]);
datafilename = char(fieldnames(current_cycle));
driving_data = current_cycle.(datafilename);
N=driving_data.time(end)/simulation_sampling;
%v =driving_data.velocity/simulation_sampling;
v_interp = interp1(driving_data.time, driving_data.velocity,simulation_sampling:simulation_sampling:driving_data.time(end));

回答 (1 件)

Max Murphy
Max Murphy 2020 年 1 月 2 日
Looks like driving_data is a timeseries class.
My guess is your velocity information is stored in the .Data property.
Try:
v = driving_data.Data/simulation_sampling;
Although, this will only work if you have been storing your velocity information in the Data property of driving_data in whatever file saves that variable to begin with.

カテゴリ

Help Center および File ExchangeVehicle Scenarios についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by