フィルターのクリア

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 Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by