when i run the code the plot graphs appears empty here is the code please help to find the mistake i made
Show older comments
here is the code I used
%calculating velocity
V3 = 10; % velocity of the piston in cm/sec
global c
th2 = pi/6; % initial value for th2
th3 = pi/6; %initial value for th3
c= 28.8:0.2:52.6;
for i = 1:.2:length(C)
c = C(i);
th3 = acos((-1425 - (C(i)).^2)./(110.*C(i)))*(180/pi);
th2 = acos((C(i).^2 - 4625)./(-4400))*(180/pi);
M = [-40*sin(th2) C(i).*sin(th3); 40*cos(th2) -C(i).*cos(th3)];
N = [V3*cos(th3); V3*sin(th3)];
W(:,i) = M\N;
end
W2 = W(1,:);
W3 = W(2,:);
figure;
subplot(2,1,1); plot(th2,W2,'r','linewidth',2);grid
xlabel('{\theta_{2}} [deg]');
ylabel('{\omega_{2}} [rad/sec]');
subplot(2,1,2); plot(th2,W3,'r','linewidth',2);grid
xlabel('{\theta_{2}} [deg]');
ylabel('{\omega_{3}} [rad/sec]');
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!