How to draw a graph for function with constraints?

조회 수: 40 (최근 30일)
Trang To
Trang To 2020년 7월 1일
댓글: Trang To 2020년 7월 2일
How can I draw the contour plot of the function z = 3x + 4y and the constraint curve x^2 + 4xy +5y^2 = 10 in the same figure ?

채택된 답변

Matt J
Matt J 2020년 7월 1일
fimplicit(@(x,y) x.^2 + 4*x.*y +5*y.^2 - 10,'r'); hold on; fcontour(@(x,y) 3*x+4*y) ; hold off

추가 답변 (1개)

Gurpreet Singh
Gurpreet Singh 2020년 7월 1일

카테고리

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