如何把年份作为日期记录在matlab中

时间:2016-02-16 14:05:47

标签: matlab date

enter image description here 1.hi,我正在尝试使用MATLAB 2010将日期刻度放在x轴上,日期范围是2011/2012,但我在x轴上有年份格式错误,Excel文件中有数据,代码如下 谢谢你的帮助

set(figure,'Color','white')
startDate = datenum(txt(w+2));
endDate = datenum(txt(end));
xData = linspace(startDate,endDate,length(de));
str = datestr(xData, 'mmm-yyyy');
plot(xData,de,'b',xData,re,'k')
NumTicks = 12;[enter image description here][1]
L = get(gca,'XLim');
set(gca,'XTick',linspace(L(1),L(2),NumTicks))
datetick('x','mmm yyyy','keeplimits', 'keepticks')
xticklabel_rotate;
set(gca,'XMinorTick','on','YMinorTick','on')
y_labels = get(gca, 'YTick');
set(gca, 'YTickLabel', y_labels); [year format error][1]

1 个答案:

答案 0 :(得分:0)

当您将01/08/2011转换为08-Jan-2011时,它会将datenum读为03/14/12。尝试更改Excel文件的格式,以便将日期设为14/03/12而不是datenum。或者,您可以更改datenum('01/08/2011','dd/mm/yyyy')命令,使其包含日期格式,如:734716。这将返回01-Aug-2011,即////This is the plugin that I have created in Xamarin using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; namespace Plugin { public class CallAction : Activity { public void Call() { var uri = Android.Net.Uri.Parse ("tel:1112223333"); var intent = new Intent (Intent.ActionDial, uri); StartActivity (intent); } } }