Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I draw 3D graph from .xls file?

1 回表示 (過去 30 日間)
Anh Tuan Bui
Anh Tuan Bui 2012 年 9 月 3 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi
I am a new Matlab user (Matlab version R2012a). I have an xls file which contain monthly observation (254 obs from Jul, 1992 to Dec, 2011) of interest rates at different maturities (17 maturities from 3 months to 120 months). Thus I have 18 columns: the first column is the date (monthly) and 17 columns are interest rates.
Could anyone help me to draw 3D graph with x = date column, y = interest rates (value from 3 to 120) is the first row in my .xls file and z = (x,y)
Thank you very much
Best regards,
Anh Tuan

回答 (1 件)

Oleg Komarov
Oleg Komarov 2012 年 9 月 3 日
  1. Import the files with xlsread()
  2. Then plot the numeric matrix with surf()
  3. [OPTIONAL ] Use datenum() to convert the first column of the imported text cell array into serial dates. Then you can use the serial dates to correctly label one of the axes (the time axis) with set(gca,'Xtick',serialdates) and datetick('x') (I am not sure which is gonna be the time axis, also you might need to invert the axis as well).
Post comments if you get stuck.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by