필터 지우기
필터 지우기

How to erase contour beyond a line or multiple lines?

조회 수: 1 (최근 30일)
Omidreza Ghafarinejad
Omidreza Ghafarinejad 2015년 6월 30일
편집: Omidreza Ghafarinejad 2015년 6월 30일
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.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by