I'm stuck on this, and no one seems to understand the question. I've defined several variables and made x an array of values. I then made an anonymous function and used fplot to graph it's outputs(F in this case) for every x value. Now, I just need to find the x value that give me F=90. The only way I can think to do it is to solve for x by hand and then type that into matlab but there has to be a simpler way. Any body know how to do this? Here's up to where I'm stuck:
% Clear all windows and variables
clc % Input the values for mass, height, friction coefficient, and gravity
m=18; % Mass (kilograms)
h=10; % Height (meters)
mu=0.55; % Friction coefficient (no units)
g=9.81; % Gravitational acceleration (m/s^2)
% Input a reasonable range for x
x=[-100:100]; % Calculate F given the range of x
F=@(x) (mu.*m.*g.*(h.^2 + x.^2).^(1/2))/(x+mu.*h); % Plot F as a function of x
fplot(F,[0,100]) title('Force versus Distance') xlabel('Distance (meters)') ylabel('Force (newtons)') grid on % Find the x value that gives F=90
??????????????
Best Answer