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

1 visualización (últimos 30 días)
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

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Stress and Strain en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by