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

1 回表示 (過去 30 日間)
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

採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 12 月 11 日
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, '-.')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStress and Strain についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by