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

2 次查看(过去 30 天)
% 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 个评论
Walter Roberson
Walter Roberson 2023-12-8
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.

请先登录,再进行评论。

回答(1 个)

madhan ravi
madhan ravi 2023-12-8
编辑:madhan ravi 2023-12-8
plot(x,Env(:,1),'b',x,Env(:,2),'r')
Note: just responding to the error message, assuming rest of the code works fine.
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by