Borrar filtros
Borrar filtros

3D surface (frontier) from a set of points

4 visualizaciones (últimos 30 días)
Marcel
Marcel el 13 de Feb. de 2015
Respondida: Hans Scharler el 1 de Abr. de 2024
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

Respuestas (1)

Hans Scharler
Hans Scharler el 1 de Abr. de 2024
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

Categorías

Más información sobre Optimization Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by