Simple question regarding "distance" function

Hi seniors
I've got matlab 2020a in my desktop. When I wanted to use distance, an error occured saying that no such function exists. Before, I was using this fuction in 2018a on another PC and it's working fine. I do find this function in 2020a documents https://uk.mathworks.com/help/map/ref/distance.html, however, the weird thing is when I type help distance in my own PC, it says no such document.
What should I do in order to use this in matlab 2020a?
Thank you in advance.

 Risposta accettata

Type:
ver
in your Command Window to see if the Mapping Toolbox is installed. It should be listed.
If it is not, and you have a license for it, use the Add-On Explorer to download it and install it.
If it is, first run:
restoredefaultpath
rehash toolboxcache
then try again and see if that solves the problem.
If it does not, use the telephone handset icon in the upper right corner of this page to request Technical Support.

8 Commenti

Thank you.
I just checked that I don't have Mapping Toolbox in the list. Will install it and hopefully this will sort it out.
Star Strider
Star Strider il 9 Apr 2020
Modificato: Star Strider il 9 Apr 2020
My pleasure!
EDIT — (9 Mar 2020 at 17:09)
If you are supposed to use the Communications Toolbox version, download the Communications Toolbox instead. The link you posted (to the documentation) was to the Mapping Toolbox, so I thought it was the function you wanted.
I've got the Communication Toolbox already but the function doesn't work. It's weird, isn't it?
Now I installed Mapping toolbox and it's working. However, I can only have Mapping toolbox for 30 days. So if I can use distance with communication toolbox, that would be great coz it doesn't have a trial period.
Do you think I should call them for support?
MATLAB 版本 9.8 (R2020a)
Simulink 版本 10.1 (R2020a)
5G Toolbox 版本 2.0 (R2020a)
Communications Toolbox 版本 7.3 (R2020a)
DSP System Toolbox 版本 9.10 (R2020a)
Deep Learning Toolbox 版本 14.0 (R2020a)
Fixed-Point Designer 版本 7.0 (R2020a)
Mapping Toolbox 版本 4.10 (R2020a)
Signal Processing Toolbox 版本 8.4 (R2020a)
Statistics and Machine Learning Toolbox 版本 11.7 (R2020a)
Symbolic Math Toolbox 版本 8.5 (R2020a)
Vehicle Dynamics Blockset 版本 1.4 (R2020a)
Vehicle Network Toolbox 版本 4.4 (R2020a)
WLAN Toolbox 版本 3.0 (R2020a)
Wireless HDL Toolbox 版本 2.0 (R2020a)
My apologies for the delay in responding.
Run these in your Command Window (or a script):
restoredefaultpath
rehash toolboxcache
then see if it works.
If you are still having problems after thatn then request Technical Support.
Thank you for the reply. Ok, I'll uninstall mapping toolbox and try this way.
There is no need to uninstall the Mapping Toolbox. It is necessary to install the Communications Toolbox, since it will automatically select the correct distance function to use with Communications Toolbox objects.
Just remember that not all "distance" functions are created equal. Most of the "distance" functions are actually methods on various objects specific to a toolbox. First you should determine what you want the distance function to do (what is the input and what is the output). Then you can figure out which distance function or functions you can use for it.
Thank you Cam. That's a good advice with a useful link. Indeed, not every distance function is useful to me and it looks like only the one in mapping toolbox is helpful since I want to calculate the sphere distance with latitude and logitude as input parameters.

Accedi per commentare.

Più risposte (1)

from that link, it looks like the distance function is part of a toolbox.
in my 2019b, distance is available from several toolboxes.
>> help distance
'distance' requires one of the following:
Antenna Toolbox
Automated Driving Toolbox
Communications Toolbox
Computer Vision Toolbox
Mapping Toolbox
Navigation Toolbox
Phased Array System Toolbox
Sensor Fusion and Tracking Toolbox

1 Commento

Thank you for this info.
I didn't realize it belongs to a toolbox. From what you have listed, it's supposed to work with Communications Toolbox which I have in my list but I don't have the Mapping Toolbox.

Accedi per commentare.

Categorie

Prodotti

Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by