필터 지우기
필터 지우기

Plot function of two variables in 2D space

조회 수: 9 (최근 30일)
Briana Canet
Briana Canet 2023년 10월 21일
편집: Matt J 2023년 10월 21일
I have the function V(x1,x2) = x1^3 + x2^2
I am trying to plot k = x1^3 + x2^2 for different values of k (i.e. k=0.2, 0.4, etc.) for x1 = [0,1] and x2 = [0,1]. The plot will be limited by the x1 and x2 values that are allowable.
I am having trouble plotting this in 2D Matlab. Any help is appreciated.
The plot should look something like this:

답변 (1개)

Matt J
Matt J 2023년 10월 21일
편집: Matt J 2023년 10월 21일
V = @(x1,x2) x1.^3 + x2.^2;
fcontour(V,[0,1])

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by