how can I compute distances:
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Robin Kaiser
el 27 de En. de 2020
Comentada: Walter Roberson
el 28 de En. de 2020
how can I compute distances:
I have a code which was running in matlab 2016:
Nat=1000;
pos=(rand(3, Nat)-0.5);
kr=dist(pos)+eye(Nat);
In my new matlab version (Matlab 2019), it seems to require an additional toolbox?
yours
Robin
0 comentarios
Respuesta aceptada
Robin Kaiser
el 28 de En. de 2020
1 comentario
Walter Roberson
el 28 de En. de 2020
kr = squeeze(sum((pos - permute(pos, [1 3 2])).^2,1)) + eye(NAT);
Más respuestas (3)
Fangjun Jiang
el 27 de En. de 2020
Run the code and then run "license inuse". Only MATLAB is needed.
2 comentarios
Walter Roberson
el 28 de En. de 2020
It is not a backward incompatibility. dist() was never part of basic MATLAB. You probably had some third-party dist() function.
Walter Roberson
el 27 de En. de 2020
dist() is part of the Deep Learning Toolbox
2 comentarios
Walter Roberson
el 28 de En. de 2020
No, it implies you used a third-party function before.
If you want to use basic MATLAB, then
kr = squareform(pdist(pos.')) + eye(Nat);
Ver también
Categorías
Más información sobre Classification en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!