Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
% 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 commentaires
Walter Roberson
le 8 Déc 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.
Réponses (1)
madhan ravi
le 8 Déc 2023
Modifié(e) : madhan ravi
le 8 Déc 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 commentaires
Dyuman Joshi
le 8 Déc 2023
@Norma, It's not clear (atleast to me) what you are asking about in the comment above.
Please be more specific.
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!