60 lines
2.0 KiB
Matlab
60 lines
2.0 KiB
Matlab
function [outputArg] = plot_brakes(panel, selected_laps, pltData)
|
|
% create tiledlayout (R2023a and newer)
|
|
tl = tiledlayout(panel,"vertical");
|
|
|
|
% plot 1: speed
|
|
ax1 = nexttile(tl);
|
|
hold(ax1, "on")
|
|
grid(ax1, "on")
|
|
title(ax1, "Speed [km/h]")
|
|
for i = 1:length(selected_laps)
|
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
|
end
|
|
% plot 2: brake pressure front/rear [bar]
|
|
ax2 = nexttile(tl);
|
|
hold(ax2, "on")
|
|
grid(ax2, "on")
|
|
title(ax2, "Brake Pressure F/R [bar]")
|
|
for i = 1:length(selected_laps)
|
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePRear_bar)
|
|
end
|
|
legend(ax2, "Front", "Rear")
|
|
% plot 3: longitudinal acceleration [g]
|
|
ax3 = nexttile(tl);
|
|
hold(ax3, "on")
|
|
grid(ax3, "on")
|
|
title(ax3, "Long Acc [g]")
|
|
for i = 1:length(selected_laps)
|
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
|
end
|
|
% plot 4: Brake Temp [°C]
|
|
ax4 = nexttile(tl);
|
|
hold(ax4, "on")
|
|
grid(ax4, "on")
|
|
title(ax4, "Brake Temp [°C]")
|
|
for i = 1:length(selected_laps)
|
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontLeft_degC)
|
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontRight_degC)
|
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearLeft_degC)
|
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearRight_degC)
|
|
end
|
|
legend(ax4, "FL", "FR", "RL", "RR")
|
|
% plot 5: brake bias [%]
|
|
ax5 = nexttile(tl);
|
|
hold(ax5, "on")
|
|
grid(ax5, "on")
|
|
title(ax5, "Brake Bias [%]")
|
|
for i = 1:length(selected_laps)
|
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeBias_perc)
|
|
end
|
|
|
|
% link all x axes
|
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
|
|
|
|
|
% return null (not relevant for plots!)
|
|
outputArg = [];
|
|
end
|
|
|