How would I plot this all in the same figure? It should have 4 diffrent functions plotted on the same figure.
clc, clear, close all
mu= 0.0016; %blood dynamic visosity Pa*s or Ns/m^2
dp_dz=-40.96; %N/m^2;
inner_radius=.0125; % meters
r=linspace(0,inner_radius,100);% inner radius is .0125
velocity_z=-0.25*mu.*dp_dz.*(inner_radius.^2-r.^2);
plot(r,velocity_z)
xlabel('Velocity in z direction')
ylabel('Radius in meters')
title('Aorta: Velocity Profile as a funtion of radius')
%%
clc, clear, close all
mu= 0.0016; %blood dynamic visosity Pa*s or Ns/m^2
dp_dz=-4800; %N/m^2;
inner_radius=.002; % meters
r=linspace(0,inner_radius,100);% inner radius is .0125
velocity_z=-0.25*mu.*dp_dz.*(inner_radius.^2-r.^2);
plot(r,velocity_z)
xlabel('Velocity in z direction')
ylabel('Radius in meters')
title('Aorta: Velocity Profile as a funtion of radius')
%%
mu= 0.0016; %blood dynamic visosity Pa*s or Ns/m^2
dp_dz=-166116; %N/m^2;
inner_radius=.000015; % meters
r=linspace(0,inner_radius,100);% inner radius is .0125
velocity_z=-0.25*mu.*dp_dz.*(inner_radius.^2-r.^2);
plot(r,velocity_z)
xlabel('Velocity in z direction')
ylabel('Radius in meters')
title('Arteriole: Velocity Profile as a funtion of radius')
%%
mu= 0.0016; %blood dynamic visosity Pa*s or Ns/m^2
dp_dz=-600000; %N/m^2;
inner_radius=.000004; % meters
r=linspace(0,inner_radius,100);% inner radius is .0125
velocity_z=-0.25*mu.*dp_dz.*(inner_radius.^2-r.^2);
plot(r,velocity_z)
xlabel('Velocity in z direction')
ylabel('Radius in meters')
title('Capillary: Velocity Profile as a funtion of radius')

 採用された回答

madhan ravi
madhan ravi 2019 年 3 月 9 日
編集済み: madhan ravi 2019 年 3 月 9 日

0 投票

Remove clc, clear and close all.
Use hold on after the first plot command. Also defining xlabel() , ylabel() and title() once is enough, you don't have to repeat it.
The appropriate way is to use subplot() because the scales of each graphs are different. You can just loop to construct the subplots.

3 件のコメント

Daniel Smith
Daniel Smith 2019 年 3 月 9 日
how would the code look with using subplot
madhan ravi
madhan ravi 2019 年 3 月 9 日
See the attached file in the answer.
Daniel Smith
Daniel Smith 2019 年 3 月 9 日
Thank you for the help. As you mentioned it was easier to just plot individually since the scales were way different.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics についてさらに検索

製品

リリース

R2018b

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by