# can any one correct this code please?

2 views (last 30 days)
MUHAMMAD UBAID KHALID on 10 Mar 2023
Answered: Cris LaPierre on 10 Mar 2023
% CRANK CONNECTING ROD EXPERIMENT
clc
clear all
close all
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
Incorrect use of '=' operator. Assign a value to a variable using '=' and compare values for equality using '=='.
14=165; %lenght of link3 in mm
wl=15; %angular velocity of input link in degree/sec
i=0;
for i=l:1:25
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 CommentsShow 1 older commentHide 1 older comment
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.

Cris LaPierre on 10 Mar 2023
Did you happen to use OCR to capture this code? I converted your text to code and ran it. From there, it appears the error is you use the number 1 to start several of your variable names instead of, what I'm guessing is supposed to be a lowercase 'l'.
It looks like the same thing has happened with your angles - They are defined as 'D1' but then in your plotting code you use '01'.
% CRANK CONNECTING ROD EXPERIMENT
clc
clear all
close all
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
l2=180; %lenght of link2 in mm
l4=165; %lenght of link3 in mm
wl=15; %angular velocity of input link in degree/sec
i=0;
for i=1:1:25
end
subplot(2,2,1)
plot(D1,l3)
xlabel( 'theeta D1')
ylabel('lenght l3')
title('Theeta VS Lenght')
subplot(2,2,2)
plot(D1,V3)
xlabel('theeta D1')
ylabel('velocity V3')
title('Theeta VS velocity')
subplot(2,2,3)
plot(D1,a3)
xlabel('theeta D1')
ylabel('acceleration a3')
title('Theeta VS accelartion') ### Categories

Find more on Logical in Help Center and File Exchange

R2016a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!