Here's code i wrote. it runs without any error but i dont see any line plot in the figure. As the equation is a sine function i want to get a plot of sine wave.
With the below codes i get the value of T in each degree from 0 to 360 at unit interval. And i also need to get the average of these values.
Can you please help me this?
I hope i was able to present my question in a understandable way.
i am happy to further clarify.
sdadhnbclc; clear all; close all;l = 0.1; % length of connecting rod
r= 0.05; % radius of crank arm
P = 500000; %pressure of the system in pascals
d= 0.05; % diameter of cylinder
A = (pi*d^2)/4; % area of the cylinder
F=P*A;for B = 0:10:360 %angle
f=F/(l*(sqrt(1-(r^2/l^2)*(sin(B))^2))); T = (f*r/l)*(sin(B))*(r*cos(B)+l*sqrt(1-(r^2/l^2)*(sin(B))^2)) % equation
plot (B,T ); hold on endxlabel("Angle (degrees))")ylabel("Torque (Nm)")grid on
Best Answer