首页 > 解决方案 > 在 Matlab 中绘制力

问题描述

我需要帮助在 matlab 中绘制 Fbr_ideal 与 Fbf_ideal 方程。目前,我收到一个空白图表。

clear all
close all
a=987.2; % Front axle to CG, mm
L=2468; % Wheelbase, mm
b=L-a; % Rear axle to CG, mm
h=517; % Height of CG
w=3698.17;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Index of terms
% Ff= ratio of Fbf to Wf
% Fr= ratio of Fbr to Wr
% ao= the ratio of ax/g
% Kbf,Kbr= respective brake distribution at fron and rear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Ideal Distribution
ao=0.2:0.1:1;
Fbf_ideal=(ao.*(b/L).*w)/(1-(ao.*(h/L)));
Fbr_ideal=(ao.*(a/L).*w)/(1+(ao.*(h/L)));
plot(Fbf_ideal,Fbr_ideal,"linewidth",2)
hold on
xlabel("Front Brake Force")
ylabel("Rear Brake Force")
title("Brake Proportioning Curve")
grid

在此处输入图像描述

标签: matlab

解决方案


那是因为Fbf_idealandFbr_ideal是标量,而不是您可能想要的数组。您可能想使用元素明智的划分:

Fbf_ideal=(ao.*(b/L).*w)/(1-(ao.*(h/L)));
%                       ^ replace with ./

接下来将绘制从轴到数据点的水平线和垂直线。

plot([Fbf_ideal;Fbf_ideal], [zeros(size(Fbf_ideal)); Fbr_ideal], 'k')
plot([zeros(size(Fbf_ideal)); Fbf_ideal], [Fbr_ideal; Fbr_ideal], 'k')

推荐阅读