MATLAB: How draw 3d plot with 3 different matix size

3d plot3d plots

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 ?

Best Answer

  • Try this
    load('germany.mat');
    dates = datetime(char(germanyields.Maturity), 'InputFormat', 'yyyy-MM');
    surf(gmaturities, dates, gyields)
    xlabel('gmaturities');
    ylabel('Date');