can any one correct this code please?
Show older comments
% CRANK CONNECTING ROD EXPERIMENT
clc
clear all
close all
L=4; %no of links
Jl=4; %no of full joints
J2=0; %no of half jonts
M=3*(L-1)-2*Jl-J2;
l1=50; %lenght of input crank in mm
12=180; %lenght of link2 in mm
14=165; %lenght of link3 in mm
D1=0:15:360; %angle of input link
wl=15; %angular velocity of input link in degree/sec
i=0;
for i=l:1:25
D2(i)=atan((ll*sind(D1(i)))/((ll*sind(D1(i)))-14))+180; %angle of link 2
13(i)=((((ll*cosd(D1(i)))-14)/cosd(D2(i)))-12)+150;%lenght of link 3
V3(i)= (-ll*sind(D1(i))*wl);%veloity of link 3
a3(i)=-ll*wl*wl*cosd(D1(i));%accelartaion of link 3
end
subplot(2,2,1)
plot(01,13)
xlabel( 'theeta 01')
ylabel('lenght 13')
title('Theeta VS Lenght')
subplot(2,2,2)
plot(01,V3)
xlabel('theeta 01')
ylabel('velocity V3')
title('Theeta VS velocity')
subplot(2,2,3)
plot(01,a3)
xlabel('theeta 01')
ylabel('acceleration a3')
title('Theeta VS accelartion')
2 Comments
Steven Lord
on 10 Mar 2023
What leads you to believe this code is not correct?
- Do you receive warning and/or error messages? If so the full and exact text of those messages (all the text displayed in orange and/or red in the Command Window) may be useful in determining what's going on and how to avoid the warning and/or error.
- Does it do something different than what you expected? If so, what did it do and what did you expect it to do?
- Did MATLAB crash? If so please send the crash log file (with a description of what you were running or doing in MATLAB when the crash occured) to Technical Support so we can investigate.
John D'Errico
on 10 Mar 2023
Why? What do YOU think is wrong with it? Code is just code, without any understanding of what it should be doing. As such, that code is perfect. It does exactly what it should do. Remember, we cannot read your mind.
Is there an error? If so, what error? Show the complete error message, so EVERYTHING IN RED.
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!