MATLAB Answers

K E
0

Why can't I access day, juliandate?

K E
さんによって質問されました 2015 年 8 月 4 日
最新アクティビティ Walter Roberson
さんによって コメントされました 2015 年 8 月 6 日
I have R2015a and can see help for day and juliandate, but I can't access to them from Matlab, and they are not in c:\Program Files\MATLAB\R2015a\, although c:\Program Files\MATLAB\R2015a\help\matlab\ref\juliandate.html is there.
juliandate(now)
Undefined function or variable 'juliandate'.
Is there a problem with my installation? Or what do I need to obtain these programs?

  0 件のコメント

サインイン to comment.

タグ

4 件の回答

Sean de Wolski
回答者: Sean de Wolski
2015 年 8 月 4 日

It's in the aerospace toolbox, are you able to pull it?
which juliandate -all
C:\Program Files\MATLAB\R2015a\toolbox\aero\aero\juliandate.m

  0 件のコメント

サインイン to comment.


James Tursa
回答者: James Tursa
2015 年 8 月 4 日
編集済み: James Tursa
2015 年 8 月 4 日

If it is just this function you need, then you could use this instead:
datenum(whatever) + 1721058.5
For day you could use datevec:
v = datevec(whatever)
d = v(:,3); % day of month

  0 件のコメント

サインイン to comment.


Peter Perkins
回答者: Peter Perkins
2015 年 8 月 5 日

KE, day is a function in the Financial Toolbox, and juliandate is a function in the Aerospace Toolbox. The fact that you're asking about both, and have R2015a, makes me wonder if perhaps you're missing those toolboxes, but are looking at documentation for the datetime data type, which has day and juliandate methods. It's new in R2014b.
>> d = datetime('now')
d =
05-Aug-2015 13:58:38
>> day(d)
ans =
5
>> juliandate(d)
ans =
2457240.08239486
datetime is more or less a replacement for the combination of the suite of datenum/datevec/datestr functions, and in general, you want to use either datetime, or use the old functions, but not mix them.

  1 件のコメント

K E
2015 年 8 月 5 日
You are right: I don't have either toolbox. I am wondering why the help for these functions is installed since it just leads to confusion. Anyway, I will use the old datenum functions.

サインイン to comment.


Peter Perkins
回答者: Peter Perkins
2015 年 8 月 6 日

KE, just to be clear, if you have MATLAB R2015a, then you have datetime, along with its day and juliandate methods. No extra toolboxes needed.

  2 件のコメント

K E
2015 年 8 月 6 日
OK, that's good to know. If I can access the help for these programs, but not the programs themselves, then does this indicate a installation problem requiring a re-install of Matlab?
Walter Roberson
2015 年 8 月 6 日
Is that definitely your error, and not
Undefined function 'juliandate' for input arguments of type 'double'.
or similar? juliandate() outside of those toolboxes is defined for datetime objects but not for strings or double

サインイン to comment.



Translated by