Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

1 visualización (últimos 30 días)
% calculations of envelope from vehicle uniformly distributed load
Max = zeros(n,n);
Min = zeros(n,n);
for j = 1:n
for i = 1:n
if Im(i,j)>= 0
Max(i,j) = Im(i,j)*q_max*dx;
Min(i,j) = 0;
end
if Im(i,j)<0
Max(i,j) = 0;
Min(i,j) = Im(i,j)*q_max*dx;
end
end
end
for i = 1:n
EnvQ(i,1) = sum(Min(:,i));
EnvQ(i,2) = sum(Max(:,i));
end
% calculations of envelope from vehicle passage
temp = [zeros(36,n);Im]
+ [zeros(24,n);Im;zeros(12,n)]
+ [zeros(12,n);Im;zeros(24,n)]
+ [Im;zeros(36,n)];
for i = 1:n
EnvV(i,1) = min(temp(:,i))*V_max;
EnvV(i,2) = max(temp(:,i))*V_max;
end
% calculations of total envelope
Env = EnvG + EnvQ + EnvV;
% preparation of figures and saving of envelopes
figure('WindowState','maximized')
x = 0:dx:sum(L);
plot(x,EnvG(:,1),'b',x,EnvG(:,2),'r',
'LineWidth',1.5)
xlim([0 sum(L)])
set(gca,'ydir','reverse','FontSize',14)
xlabel('x [m]')
ylabel('M [kNm]')
title('Env M(G)')
grid
saveas(gcf,'Env_M(G).fig')
saveas(gcf,'Env_M(G).bmp')
figure('WindowState','maximized')
x = 0:dx:sum(L);
plot(x,EnvQ(:,1),'b',x,EnvQ(:,2),'r',
'LineWidth',1.5)
xlim([0 sum(L)])
set(gca,'ydir','reverse','FontSize',14)
xlabel('x [m]')
ylabel('M [kNm]')
title('Env M(Q)')
grid
saveas(gcf,'Env_M(Q).fig')
saveas(gcf,'Env_M(Q).bmp')
figure('WindowState','maximized')
x = 0:dx:sum(l);
plot(x,EnvV(:,1),'b',x,EnvV(:,2),'r',
'LineWidth',1.5)
xlim([0 sum(L)])
set(gca,'ydir','reverse','FontSize',14)
xlabel('x [m]')
ylabel('M [kNm]')
title('Env M(V)')
grid
saveas(gcf,'Env_M(V).fig')
saveas(gcf,'Env_M(V).bmp')
figure('WindowState','maximized')
x = 0:dx:sum(L);
plot(x,Env(:,1),'b',x,Env(:,2),'r',
'LineWidth',1.5)
xlim([0 sum(L)])
set(gca,'ydir','reverse','FontSize',14)
xlabel('x [m]')
ylabel('M [kNm]')
title('Env M(G,Q,V)')
grid
saveas(gcf,'Env_M.fig')
saveas(gcf,'Env_M.bmp')
plot(x,EnvG(:,1),'b',x,EnvG(:,2),'r',
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for
mismatched delimiters.
  3 comentarios
Norma
Norma el 8 de Dic. de 2023
yes, can u solve my problem. because the code from paper i think stil incorrect
Walter Roberson
Walter Roberson el 8 de Dic. de 2023
Everything before the final line you posted is part of table 2, ending at the bottom of the second last panel of table 2 right above the MATLAB logo.
The final line you posted is a partial line from roughly 1/2 way down on the final panel of table 2, posted missing some of the lines above it. The line got truncated by whoever copied it. The actual line is
plot(x,EnvQ(:,1),b,x,EnvQ(:,2),r, LineWidth,1.5)
but you need the other lines from the last panel of table 2.

Iniciar sesión para comentar.

Respuestas (1)

madhan ravi
madhan ravi el 8 de Dic. de 2023
Editada: madhan ravi el 8 de Dic. de 2023
plot(x,Env(:,1),'b',x,Env(:,2),'r')
Note: just responding to the error message, assuming rest of the code works fine.
  3 comentarios
Dyuman Joshi
Dyuman Joshi el 8 de Dic. de 2023
@Norma, It's not clear (atleast to me) what you are asking about in the comment above.
Please be more specific.

Iniciar sesión para comentar.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by