Borrar filtros
Borrar filtros

Plot a line out of a 2D array

1 visualización (últimos 30 días)
Prasanth Warrier
Prasanth Warrier el 11 de Nov. de 2020
Comentada: Rafael Hernandez-Walls el 11 de Nov. de 2020
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 comentarios
KSSV
KSSV el 11 de Nov. de 2020
Read about plot.
Rafael Hernandez-Walls
Rafael Hernandez-Walls el 11 de Nov. de 2020
TDMA?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Solar Power en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by