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

4 ビュー (過去 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 件のコメント
Norma
Norma 2023 年 12 月 8 日
yes, can u solve my problem. because the code from paper i think stil incorrect
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 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 12 月 8 日
@Norma, It's not clear (atleast to me) what you are asking about in the comment above.
Please be more specific.
Image Analyst
Image Analyst 2023 年 12 月 8 日
What is n and Im in your code? We can't run it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by