Is matlab function distance is broken ?
Ältere Kommentare anzeigen
Hello,
I try to calculate the distance between two points on a sphere. It seems that the function distance is built-in https://www.mathworks.com/help/map/ref/distance.html
But I'm unable to make it work, even the examples in the doc seem to not work :
arclen = distance('gc',[37,-76],[37,-9])
arclen = distance('rh',[37,-76],[37,-9])
I always have this error :
Check for missing argument or incorrect argument data type in call to function 'distance'.
I even tried syntax like that :
[arclen,az] = distance('gc',[37,-76],[37,-9])
But nothing seems to work, why ? I'm using Matlab R2020a, is it deprecated ?
5 Kommentare
Ameer Hamza
am 2 Jun. 2020
It works fine on my system. Can you show the output of
which distance
Aymeric Ferreira
am 2 Jun. 2020
Bearbeitet: Aymeric Ferreira
am 2 Jun. 2020
Ameer Hamza
am 3 Jun. 2020
Bearbeitet: Ameer Hamza
am 3 Jun. 2020
Aymeric Ferreira
am 3 Jun. 2020
Ameer Hamza
am 3 Jun. 2020
Aymeric, I added it as an answer. You can accept it.
Akzeptierte Antwort
Weitere Antworten (1)
Mark Brandon
am 2 Jun. 2020
0 Stimmen
It's your install.
Screen grab from those commands on my 2020a Update 2

un-install and clean install again?
good luck. MB
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!