フィルターのクリア

Plot a line out of a 2D array

1 回表示 (過去 30 日間)
Prasanth Warrier
Prasanth Warrier 2020 年 11 月 11 日
I have a 2D array of 120 x 50 . This is a 1-D Carburisation Problem program to find out concentration profile of C from surface to centre.
So herein, i wish to highlight and showcase only the value of C after 1hr , 3hr and 10hrs and plot them
How do i do that?
% Geometrical parameters
Cs = 1;
L = 0.005; %length of steel piece
D = 2*10^(-11); %diffusivity of carbon in iron
N = 50; %number of grid points
dx = L/(N-1);
x = [0:dx:L];
t = 36000; % total time 10hrs
dt = 300; % time step
K = t/dt; %iteartion
Co(1:K,1:N)= 0.20;
C(1:K,1:N) = 0.20;
AE(1:N) = D/(dx);
AE(1) = 0; % west boundary
AE(end) = 0; % east boundary
AW(1:N) = D/(dx);
AW(1) = 0; % west boundary
Apo(1:N) = dx/(dt);
Apo(end) = dx/(2*(dt));
AP = AE + AW + Apo;
AP(1) = 1;
p = -AW;
q = AP;
r = -AE;
d(1:N) = 0;
for i = 1:K
d = Apo.*Co(i,1:N);
d(1) = Cs;
C(i,1:N) = TDMA(p,q,r,d);
Co(i+1,1:N) = C(i,1:N);
end
  2 件のコメント
KSSV
KSSV 2020 年 11 月 11 日
Read about plot.
Rafael Hernandez-Walls
Rafael Hernandez-Walls 2020 年 11 月 11 日
TDMA?

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by