How to connect the plot point using a line in Matlab using For loop for the below mentioned code??
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gokulraj Nattamangalathar Raju
le 11 Déc 2023
Commenté : Dyuman Joshi
le 11 Déc 2023
v=89.2/60;
l=0.313;
t=0.05;
strain=0.0003537;
step = 0.001;
for i = 0.001 : step : t
i_t=i;
Q_out = (v*i_t)/abs((1-strain));
strain = Q_out;
disp(strain)
plot(i_t,Q_out,'.');
hold on
end
0 commentaires
Réponse acceptée
Dyuman Joshi
le 11 Déc 2023
Best to allocate the data in an array first and then plot -
v=89.2/60;
l=0.313;
t=0.05;
strain=0.0003537;
step = 0.001;
i_t = 0.001 : step : t;
Q_out = zeros(size(i_t));
for k = 1:numel(i_t)
Q_out(k) = (v*i_t(k))/abs((1-strain));
strain = Q_out(k);
end
figure
plot(i_t, Q_out, '-.')
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Stress and Strain 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!