【发布时间】:2017-10-09 11:22:25
【问题描述】:
使用以下变量:
-
SP:包含随机数的已知 8x1 行向量。 -
YP:包含随机数的已知 8x1 行向量。
我有八个数据点。对于 x 轴上的每 8 个数据点,我有以下标签:
资产1 - 资产2 - 资产3 - 资产4 - 资产5 - 资产6 - 资产7 - 资产8
问题:当我实现我的代码时,我得到了无数个上述标签。
这是我从 MatLab 得到的输出:
这是我的代码:
SP = rand(8,1)/100;
YP = (rand(8,1)/100)*2;
plot(YP,'DisplayName','YP');
hold on;
plot(SP,'DisplayName','SP');
hold off;
title('SP and YP monthly returns');
xlabel('Monthly time series');
MY = 'Siemens SAP Daimler Allianz DEU.Telekom Adidas BMW DEU.Bank';
set(gca, 'xTickLabels', 'Asset1 Asset2 Asset3 Asset4 Asset5 Asset6 Asset7 Asset8');
xticklabel_rotate('Asset1 Asset2 Asset3 Asset4 Asset5 Asset6 Asset7 Asset8');
ylabel('Percentage of prices discounts');
set(gca, 'yTickLabels', num2str(100.*get(gca,'yTick')','%g%%'));
【问题讨论】: