필터 지우기
필터 지우기

Built in Julian Date Converter not working?

조회 수: 6 (최근 30일)
Evan Mossel
Evan Mossel 2018년 7월 20일
편집: Evan Mossel 2018년 7월 20일
I am using the built in function jd = juliandate(y,mo,d,h,mi,s) to convert UTC to JD. It does not work. It gives me an error that says the function is undefined. Do I need top download something for it to work? It says no downloads are needed.

답변 (2개)

James Tursa
James Tursa 2018년 7월 20일
편집: James Tursa 2018년 7월 20일
What version of MATLAB are you using? juliandate was introduced in R2014b. Are you using an unsupported class variable as one of the inputs?
  댓글 수: 4
Evan Mossel
Evan Mossel 2018년 7월 20일
jd = juliandate(2018,7,20,11,7,00);
Errors:
Undefined function 'juliandate' for input arguments of type 'double'.
Error in jdtest3 (line 1) jd = juliandate(2018,7,20,11,7,00)
Evan Mossel
Evan Mossel 2018년 7월 20일
편집: Evan Mossel 2018년 7월 20일
UPDATE: My input parameters were not correct syntax. The problem is resolved

댓글을 달려면 로그인하십시오.


Steven Lord
Steven Lord 2018년 7월 20일
There are at least two functions named juliandate in MathWorks products. The juliandate function in Aerospace Toolbox accepts double precision inputs. That's the one your code is attempting to call, but I suspect you don't have that toolbox installed. The juliandate function in MATLAB requires a datetime array as input. This function introduced in MATLAB in release R2014b, and so is the one to which James referred.
If you want to use the datetime juliandate function, you will need to convert your numeric year, month, day, etc. data into a datetime array using the datetime function then pass that datetime array into juliandate.
In the future you may find the datetime function syntax using the 'ConvertFrom' option useful if you want to convert from a Julian date.

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by