graph is not showing

1 回表示 (過去 30 日間)
Hasan
Hasan 2024 年 12 月 21 日
コメント済み: Hasan 2024 年 12 月 21 日
there are the values i calculate but i cannot see graph in plotting. anybody help me? here my code:
clc
clear all
close all hidden
P=1; % assuming and constant
Ex=20*10^4;
Ey=2*10^4;
Ea=0.1*10^4;
k=0.1;
t=0.01;
b=0.05;
h=0.1;
ExGxy=17;
Ah=((Ex/Ey)^0.25)*(k*(Ey/Ea)+0.5)/3;
a=(0.01:0.005:0.08);
fprintf('%10s %10s\n','Energy Release Rate','Crack Length');
for a=0.01:0.005:0.08
G= (P^2/(Ex*b^2*h))*((12*(a/h+1/Ah)^2)+1.2*ExGxy);
fprintf('%10.4f %10.4f \n', G, a)
end
figure, plot(a, G,'k-'), axis equal;
xlabel('Crack Length (a)'), ylabel('Energy Release Rate (G)');

回答 (1 件)

Torsten
Torsten 2024 年 12 月 21 日
編集済み: Torsten 2024 年 12 月 21 日
P=1; % assuming and constant
Ex=20*10^4;
Ey=2*10^4;
Ea=0.1*10^4;
k=0.1;
t=0.01;
b=0.05;
h=0.1;
ExGxy=17;
Ah=((Ex/Ey)^0.25)*(k*(Ey/Ea)+0.5)/3;
a=(0.01:0.005:0.08);
fprintf('%10s %10s\n','Energy Release Rate','Crack Length');
Energy Release Rate Crack Length
for i=1:numel(a)
G(i)= (P^2/(Ex*b^2*h))*((12*(a(i)/h+1/Ah)^2)+1.2*ExGxy);
fprintf('%10.4f %10.4f \n', G(i), a(i))
end
0.5521 0.0100 0.5713 0.0150 0.5917 0.0200 0.6133 0.0250 0.6361 0.0300 0.6601 0.0350 0.6853 0.0400 0.7116 0.0450 0.7392 0.0500 0.7680 0.0550 0.7980 0.0600 0.8292 0.0650 0.8616 0.0700 0.8952 0.0750 0.9300 0.0800
figure, plot(a, G,'k-'), axis equal;
xlabel('Crack Length (a)'), ylabel('Energy Release Rate (G)');
  1 件のコメント
Hasan
Hasan 2024 年 12 月 21 日
thank you so much Torsten :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by