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