## how to plot each raw and each column of the matrix?

Asked by Shangeetha Mahendran

on 19 Dec 2018

### Akshay Khadse (view profile)

on 27 Dec 2018
I have to get graphs similar to attached file function pde1
clc; clear; close all
m=1; %cylindrical geometry
R=3e-3; %radius of lumen (m)
dm = 13.04e-6; % TM thickness (m)
r1 =R + dm; %radius of outer surface of membrane (m)
L=1.2; %height of the membrane (m)
Q = 6.5e-9; %volumetric flow rate
D=1.76e-9; %diffusion coefficient of ammonia in liquid m2/s
RT = 2477.6; %J/mol
H = 1.62; %Henry's law constant Pam^3/mol
u0= 285.1; %inflow concentration
zn=10; % grid line z (actually z denoted by t
xn = 10; % grid-steps channel x-axis(radius side)
xmesh = linspace(0,R,xn);
zspan =linspace(0,L,zn); %counter point of length% spatial solution domain (m)
dx = 1/(xn-1);
x = [xmesh]; %x vector
z =[zspan]; %t vector
U_a = Q/3.14/R^2; % average velocity
sol =pdepe(m,@pdefun,@pdeic,@pdebc,xmesh,zspan);
u=sol(:,:,1)
surf(x,z,u)
ylabel('height')
figure
plot(x/R,u(end,:)/u0)
ylabel('concentration')
figure
plot(z/L,u(:, end)/u0)
xlabel('height')
ylabel('c')
figure
hold on
for i =1:zn
plot(x
/R,u(i,:),'.k')
hold off
end
xlabel('position ')
ylabel('concentration in every row')
figure
hold on
for ii =1:xn
plot(z/L,u(:,ii),'.')
hold off
end
xlabel('position ')
ylabel('concentration in every colomn')
%%
function [c,f,s]= pdefun(x,z,u,DuDx)
c = U_a/D;
f = DuDx;
s=0;
end
%% initial condition
function u0 = pdeic(x)
u0 =285.1;
end
%%
function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,z)
pl=0;
ql=1;
pr=u0;
qr=1;
end
save('results.mat');
end

Show 1 older comment

### madhan ravi (view profile)

on 19 Dec 2018
is that plot which comes inside the loop? which one are you trying to plot?
Shangeetha Mahendran

### Shangeetha Mahendran (view profile)

on 19 Dec 2018
I creat the loop because it should read every row/column
Shangeetha Mahendran

### Shangeetha Mahendran (view profile)

on 19 Dec 2018
@stephan,
Actually i used the loop,
but it doen't work

R2017b
{"ft_lang_label":"__label__en","ft_lang_prob":0.6993029,"math_prob":0.96385056,"size":1966,"snap":"2019-35-2019-39","text_gpt3_token_len":515,"char_repetition_ratio":0.14576963,"word_repetition_ratio":0.12080537,"special_character_ratio":0.24059004,"punctuation_ratio":0.11299435,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99797946,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-19T05:15:40Z\",\"WARC-Record-ID\":\"<urn:uuid:e9d45c32-78a1-4b22-a459-53a6ab382fd6>\",\"Content-Length\":\"120416\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:353d2c84-b90b-4290-bbfc-7d9703f59014>\",\"WARC-Concurrent-To\":\"<urn:uuid:7171f767-0abd-4e9e-bf6e-70b0c82580bd>\",\"WARC-IP-Address\":\"104.118.179.86\",\"WARC-Target-URI\":\"https://www.mathworks.com/matlabcentral/answers/436474-how-to-plot-each-raw-and-each-column-of-the-matrix\",\"WARC-Payload-Digest\":\"sha1:UVI242YJKTNNY6JCAVQDWSHKRV57HJ4M\",\"WARC-Block-Digest\":\"sha1:HYBUMYT5J5OO6SNB32FYQXTEQE5TQ4GG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514573439.64_warc_CC-MAIN-20190919040032-20190919062032-00257.warc.gz\"}"}