*Matrix dimensions must agree error*
Show older comments
I am relatively new to Matlab and is working on a problem but keep getting this error. Please help! I attached the matlab file, but is also posting a screenshot.

Accepted Answer
More Answers (1)
Mohamad
on 23 Nov 2020
Hi , I made the required corrections in the code , now it is working , I also plot y1 and y3 .
%==============================
% Computer based assigment - dynamics
%==============================
% Question 1
%Given
L1=14;
L2=25;
L3=2;
L4=100;
Vb=6;
V1=40;
g=9.81;
x=linspace(0.5,1);
Vx=V1*cos(x);
Vy=V1*sin(x);
%===========
%Calculations
%===========
y1=(L4./(V1*cos(x)));
y3=(-0.5*g*(L4./(Vx).^2)+Vy.*(L4./(Vx))+L3);
y3=Vb*(L4./(Vx))+L1;
subplot(211) ; plot(x,y1) ; grid
subplot(212) ; plot(x,y3) ; grid
1 Comment
Alan Stevens
on 23 Nov 2020
Note that you have two expressions for y3.
Categories
Find more on Matrices and Arrays 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!