필터 지우기
필터 지우기

Plot a line out of a 2D array

조회 수: 1 (최근 30일)
Prasanth Warrier
Prasanth Warrier 2020년 11월 11일
댓글: Rafael Hernandez-Walls 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 CenterFile Exchange에서 Solar Power에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by