필터 지우기
필터 지우기

3D surface (frontier) from a set of points

조회 수: 5 (최근 30일)
Marcel
Marcel 2015년 2월 13일
답변: Hans Scharler 2024년 4월 1일
Hello,
I would like to create a 3D surface plot out of 15 data points(x,y,z).
x=[0.0080,0.0044,0.0068,0.0040,0.0061,0.0068,0.0067,0.0041,0.0034,0.0049,0.0058,0.0069,0.0037,0.0050,0.0052];
y=[0.0044,0.0015,0.0039,0.0024,0.0016,0.0040,0.0028,0.0019,0.0018,0.0027,0.0024,0.0030,0.0020,0.0019,0.0022];
z=[-0.7422,-0.5890,-0.2624,-0.4232,-0.7427,-0.2631,-0.4131,-0.4303,-0.4680,-0.3782,-0.3646,-0.3505,-0.4246,-0.4694,-0.4074];
I need the plot like a frontier of combinations similar to this figure:
Only think I know so far is to use the surf function, but I think some adaptions need to be done to get this type of figure.
How can this be done ?
Thank you in advance.
Regards

답변 (1개)

Hans Scharler
Hans Scharler 2024년 4월 1일
You can use the 3D surface plot.
x=[0.0080,0.0044,0.0068,0.0040,0.0061,0.0068,0.0067,0.0041,0.0034,0.0049,0.0058,0.0069,0.0037,0.0050,0.0052];
y=[0.0044,0.0015,0.0039,0.0024,0.0016,0.0040,0.0028,0.0019,0.0018,0.0027,0.0024,0.0030,0.0020,0.0019,0.0022];
z=[-0.7422,-0.5890,-0.2624,-0.4232,-0.7427,-0.2631,-0.4131,-0.4303,-0.4680,-0.3782,-0.3646,-0.3505,-0.4246,-0.4694,-0.4074];
[XI, YI] = meshgrid(linspace(min(x), max(x), 100), linspace(min(y), max(y), 100));
ZI = griddata(x, y, z, XI, YI, 'cubic');
figure;
surf(XI, YI, ZI);
colormap jet
xlabel('Return');
ylabel('Risk');
zlabel('Skewness');
title('The shape of the skewness');
view(-60, 30);
The shape of the skewness

카테고리

Help CenterFile Exchange에서 Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by