フィルターのクリア

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