2 views (last 30 days)

Trying to plot corner speed vs mass of a vehicle. But when I plot I don't get a line.

%% once this works, add a user defined input for radius

mu = 1; %%Coefficient of friction

r =80; %% the regular line radius is 30m, the racing line is 80m

g = 9.81; %%Gravitational constant

%%m = x;

x = 1000:50:1250 %% car mass for the input roughly 2000-2800 lbs

y = sqrt((mu*(x*g)*r)/x) %% calculates velocity in Meters / second

Where I would expect it to enter the series of x into the equation y= sqrt... , it displays x 1000, 1050 etc in the workspace, but only displays y as 28.0143, which I would expect if it was ONLY calculating the 1000kg value. and not the expected 1000, 1050, 1100, 1150, 1200, 1250 inputted into x of the equation.

KALYAN ACHARJYA
on 9 Aug 2019

Edited: KALYAN ACHARJYA
on 9 Aug 2019

y = sqrt((mu*(x*g)*r)./x) %% calculates velocity in Meters / second

%....................^.........

Now

x =

1000 1050 1100 1150 1200 1250

y =

28.0143 28.0143 28.0143 28.0143 28.0143 28.0143

Please check, why it giving constant value? Plot will be horizantal line.

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 5 Comments

## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733465

⋮## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733465

## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733522

⋮## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733522

## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733541

⋮## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733541

## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733727

⋮## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733727

## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733757

⋮## Direct link to this comment

https://nl.mathworks.com/matlabcentral/answers/475541-matlab-only-outputs-one-variable-and-doesn-t-plot-a-line#comment_733757

Sign in to comment.