predicting speed time for normal car from 0 to 35mph
2 views (last 30 days)
Show older comments
with the first tab in this excel file Car data which is a OBD2 Data read out I have to use this data to make a model that should be based on accelerating from rest to 35 mph and braking from 35 mph to rest. Your model needs to be able to predict the following things:
- 0 to a given speed time (Example 0 – 35 mph time)
- Braking time from any given speed.
- Engine RPM vs speed for different gears.
- How much gas your car uses for a given course.
- A model of power vs speed for your vehicle.
Below is my code so far but I am honestly lost on where to go next...? I would think that using the interp1() function would be my best bet but i have not figured out a way to make the data come together with that method??? any guidance will be greatly appreciated!!
[~,sheet_name2] = xlsfinfo('OBD2 Data.xlsx');
for j = 1:numel(sheet_name2)
data2{j} = xlsread('OBD2 Data.xlsx',sheet_name2{j});
end;
% figure(3)
% plot(data2{1,1})
% figure(4)
% plot(data2{1,2})
% figure(5)
% plot(data2{1,3})
% figure(6)
% plot(data2{1,4})
% figure(7)
% plot(data2{1,5})
% figure(8)
% plot(data2{1,6})
%% 0 to a given speed time (Example 0 – 35 mph time)
Time = data2{1}(:,1);
Acceleration01 = data2{1}(:,2);
Acceleration02 = data2{1}(:,3);
Acceleration03 = data2{1}(:,4);
Velocity01 = Acceleration01.*Time;% V = a * t m/s
Velocity02 = Acceleration02.*Time;% V = a * t m/s
Velocity03 = Acceleration03.*Time;% V = a * t m/s
Velocity035 = [Velocity01 Velocity02 Velocity03];
figure(9)
plot(Time,Velocity035);
x = Time;
y1 = Velocity01;
Z = polyfit(y1,x,35)
figure(10)
plot(Z)
0 Comments
Answers (0)
See Also
Categories
Find more on Biotech and Pharmaceutical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!