How draw 3d plot with 3 different matix size

Hi everybody. I hav a time series,from 1990 up To 2020 yearly ,and i have a 13 different maturity . There is yiels matrix,which its ros equal no of year and column equel no of maturitis. I want to hve a 3d plot that x= year,y= maturity ,z= yields I use surf(x,y,z) but there is error. Pls help me ?

2 comentarios

Ameer Hamza
Ameer Hamza el 14 de Mayo de 2020
Can you share a sample dataset?
masoumeh solgi
masoumeh solgi el 15 de Mayo de 2020
than k you for respone,i attached my data

Iniciar sesión para comentar.

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 15 de Mayo de 2020
Try this
load('germany.mat');
dates = datetime(char(germanyields.Maturity), 'InputFormat', 'yyyy-MM');
surf(gmaturities, dates, gyields)
xlabel('gmaturities');
ylabel('Date');

3 comentarios

masoumeh solgi
masoumeh solgi el 15 de Mayo de 2020
thank you so much,its exactly that i wanted,but i run in the metlab and the output is like this(the place of axis x and y replaced),i rote it but it was noy like yours.
so sorry that my questions are so basic.
Ameer Hamza
Ameer Hamza el 15 de Mayo de 2020
Editada: Ameer Hamza el 15 de Mayo de 2020
Yes, I rotated it manually. You can try the following code.
load('germany.mat');
ax = axes();
dates = datetime(char(germanyields.Maturity), 'InputFormat', 'yyyy-MM');
surf(gmaturities, dates, gyields)
xlabel('gmaturities');
ylabel('Date');
ax.YDir = 'reverse';
Are you looking for some other modification?
masoumeh solgi
masoumeh solgi el 15 de Mayo de 2020
yes,exactlly:))

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 14 de Mayo de 2020

Comentada:

el 15 de Mayo de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by