![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/322231/image.png)
How can I cut the connection between the areas?
1 次查看(过去 30 天)
显示 更早的评论
Hello,
i am trying to plot the two graphs and fill the area between the two graphs but only if Ventricle < Atrium. I already could fill the are but i want to cut the connection between the areas. Any ideas how I can seperat them?
%Import Data
Druck = readtable("Part1.txt","Delimiter",'space',"DecimalSeparator",",","ReadVariableNames",false);
TabDruck = Druck(:,4:5);
TabDruck.Properties.VariableNames{1} = 'LV';
TabDruck.Properties.VariableNames{2} = 'LA';
Ventricle = (TabDruck{:,"LV"})';
Atrium = (TabDruck{:,"LA"})';
time = 1:length(Ventricle);
condition = (Ventricle < Atrium)';
tcon = time(condition);
Vcon = Ventricle(condition);
Acon = Atrium(condition);
tLiegBed2 = [tcon, fliplr(tcon)];
inBetween = [Vcon, fliplr(Acon)];
%plot
plot(time,Ventricle,'r')
hold on
plot(time,Atrium,'g')
fill(tLiegBed2, inBetween, 'g','Linestyle','none');
hold off
0 个评论
采纳的回答
darova
2020-6-26
Try surf
x = [time; time];
y = [Ventricle; min([Ventricle;Atrium])];
surf(x,y,x*0,'edgecolor','none','facecolor','r')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/322231/image.png)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biomedical Imaging 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!