How to erase contour beyond a line or multiple lines?

2 visualizzazioni (ultimi 30 giorni)
Hi. I have contour of a function. I want to plot this contour over a triangle domain. I have the equations of the triangle boundary. So I think I must plot contour at first and then erase contour beyond the boundary lines. But I don't know how to do it. This is my code:
clc
clear all
T=100;
a=0.3;
syms y z real
tauxy=5.1966*T*z*(2*sqrt(3)*y+a)/a^5;
tauxz=5.1966*T*(-sqrt(3)*y^2+sqrt(3)*z^2+a*y)/a^5;
tau=sqrt(tauxy^2+tauxz^2);
z1=(sqrt(3)*y-a)/3;
z2=-z1;
figure(1)
ezcontour(tau,[-a/(2*sqrt(3)),a/sqrt(3),-0.16,0.16]);
hold on
ezplot(z1,[-a/(2*sqrt(3)) a/sqrt(3)]);
ezplot(z2,[-a/(2*sqrt(3)) a/sqrt(3)]);
axis([-a/(2*sqrt(3)),a/sqrt(3),-0.16,0.16]);
can anyone help me to do this job? if you can show me a better way to plot the contour restricted between these lines then I will be thankful. Also I want to know how to plot more contour lines in the triangle domain since most of the lines are out of the boundaries.

Risposte (0)

Categorie

Scopri di più su Contour Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by