Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Plotting in groups by two variables?

조회 수: 1 (최근 30일)
Iris Li
Iris Li 2018년 5월 15일
마감: MATLAB Answer Bot 2021년 8월 20일
1.How should I plot strike_price to mid_value grouped by date and by maturity? i.e. I would like to get 4 plots with label "date:20160418;maturity:1","date:20160418;maturity:2","date:20160419;maturity:1","date:20160419;maturity:2". 2.Another two plots with 2 lines each. i.e. plot A:"date:20160418;maturity:1","date:20160418;maturity:2" and plot B:"date:20160419;maturity:1","date:20160419;maturity:2". Thank you in advance!!!!!!
date = {'20160419';'20160419';'20160419';'20160419';'20160419';'20160419';'20160418';'20160418';'20160418';'20160418'};
cp_flag = {'C';'C';'C';'P';'P';'P';'C';'C';'P';'P'};
maturity = [2;2;1;2;2;1;2;1;2;1];
strike_price = [40;30;20;40;30;20;40;30;40;30];
mid_value = [0.021; 0.022; 0.033; NaN; 0.025;0.026;0.027; 0.028; 0.039; 0.041];
T = table(date,cp_flag,maturity,strike_price,mid_value)
T =
10×5 table
date cp_flag maturity strike_price mid_value
__________ _______ ________ ____________ _________
'20160419' 'C' 2 40 0.021
'20160419' 'C' 2 30 0.022
'20160419' 'C' 1 20 0.033
'20160419' 'P' 2 40 NaN
'20160419' 'P' 2 30 0.025
'20160419' 'P' 1 20 0.026
'20160418' 'C' 2 40 0.027
'20160418' 'C' 1 30 0.028
'20160418' 'P' 2 40 0.039
'20160418' 'P' 1 30 0.041

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by