How to connect the plot point using a line in Matlab using For loop for the below mentioned code??

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

Dyuman Joshi
Dyuman Joshi il 11 Dic 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, '-.')

Più risposte (0)

Categorie

Scopri di più su Stress and Strain in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by