フィルターのクリア

Can someone please help with following conversion :

3 ビュー (過去 30 日間)
Aswas
Aswas 2015 年 7 月 12 日
コメント済み: Walter Roberson 2015 年 7 月 12 日
_ Can someone please help with following conversion : _
t = datetime(731885.75,'ConvertFrom','datenum')
Undefined function 'datetime' for input arguments of type 'double'.
Error in Untitled (line 2)
t = datetime(731885.75,'ConvertFrom','datenum')

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 12 日
datetime was introduced since Matlab 2014b, what is your Matlab version?
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 12 日
Use
t = datestr(731885.75)
Aswas
Aswas 2015 年 7 月 12 日
Thank you sir, works, but how do I get the proper time reflected in my plots please?

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 7 月 12 日
datetime() was introduced in R2014b; you probably have a version earlier than that.
  3 件のコメント
Aswas
Aswas 2015 年 7 月 12 日
編集済み: Azzi Abdelmalek 2015 年 7 月 12 日
Sorry am new to Matlab, just doing practice run with small data before starting on my assignment,imported excel sheet, loaded code, can't get time right on my plot please...
%%Allocate imported array to column variable names
timeprac = data(:,1);
windspeedprac = data(:,2);
Pressureprac = data(:,3);
Tempprac = data(:,4);
%%Clear temporary variables
clearvars data raw;
%%vv
displaytime = datestr(timeprac);
plot(windspeedprac,timeprac),title('Wind Speed versus time'),xlabel('wind speed (km/hr)'),ylabel('time t (HH:MM:SS)');
datetick('y')
_ error: _
Error in dateTickPicker (line 104)
yrHigh = datenum(yearHigh,1,1);
Error in datetick>bestscale (line 292)
[labels,format] = dateTickPicker(axh,[xmin,xmax],dateform,dateChoice,axVal);
Error in datetick (line 253)
[ticks,dateform] = bestscale(axh,ax,vmin,vmax);
Error in PracCode (line 22)
datetick('y')
Walter Roberson
Walter Roberson 2015 年 7 月 12 日
The convention is that the independent variable should go on the x axis and the dependent variable should go on the y axis. Does windspeed lead to a change in time, or does time lead to a change in windspeed?
plot(timeprac, windspeedprac);
title('Wind Speed versus time');
xlabel('time t (HH:MM:SS)');
ylabel('wind speed (km/hr)');
datetick('x', 'HH:MM:SS');

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by