Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 5-by-1.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
balasubramanian s
el 6 de Nov. de 2019
Comentada: balasubramanian s
el 6 de Nov. de 2019
clc;
Cd=xlsread('trial',1,'b2:b6');
rho = xlsread('trial',1,'a1:a6');
S=3.2365;
m=1000;
gama=10;
H=input('enter altitude in meter (m)');
V=input('enter the velocity (m/s)');
dt=1;
t=0:dt:10^3;
n=(10^3/dt+1);
Ux=zeros(1,n);
Ux = V*cos(gama);
Uy = V*sin(gama);
for i=1:n
D=0.5.*rho*V^2*S.*Cd;
Ux(1,i+1)=Ux(1,i)-(dt)*(D/m*cos(gama));
Uy(1,i+1)=Uy(1,i)+(dt)*(g-(D/m*sin(gama)));
V(1,i+1)=((Ux(1,i+1))^2+(Uy(1,i+1)^2)^0.5;
i=i+1;
end
0 comentarios
Respuesta aceptada
James Tursa
el 6 de Nov. de 2019
Looks like Cd and rho are vectors. So the result of those calculations on the right hand side will be vectors. But you are trying to stuff them into a scalar element. You need to rethink what you are doing.
Más respuestas (1)
Lasse Jakobsen
el 6 de Nov. de 2019
I think it will be easier to help find the problem, if you provide either the excel-sheet, the workspace variables, or if you type in Cd and rho manually, since these are not available when you just give the script.
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!