New to Matlab! I've been messing around with this open source code to make it do what I want and it does, but not the way I want it to. I just need some help wrapping this up.
This is what I have so far:
clear
global geodesic_library;
geodesic_library = 'geodesic_debug'; %"release" is faster and "debug" does additional checks
rand('state', 0); %comment this statement if you want to produce random mesh every time
load V3_Elements4GeodesicD.k
load V3_Nodes4GeodesicD.k
vertices = V3_Nodes4GeodesicD (:, [2 3 4]);
faces = V3_Elements4GeodesicD (:, [3 4 5]);
N = 12240; %number of points in a mesh
mesh = geodesic_new_mesh(vertices,faces); %initilize new mesh
algorithm = geodesic_new_algorithm(mesh, 'exact'); %initialize new geodesic algorithm
vertex_id = 6707 ; %create a single source at vertex #1
source_points = {geodesic_create_surface_point('vertex',vertex_id,vertices(vertex_id,:))};
geodesic_propagate(algorithm, source_points); %propagation stage of the algorithm (the most time-consuming)
vertex_id = 12240; %create a single destination at vertex #N
destination = geodesic_create_surface_point('vertex',vertex_id,vertices(vertex_id,:));
path = geodesic_trace_back(algorithm, destination); %find a shortest path from source to destination
distances = zeros(N,1); %find distances to all vertices of the mesh (actual pathes are not computed)
[source_id, distances] = geodesic_distance_and_source(algorithm) %find distances to all vertices of the mesh; in this example we have a single source, so source_id is always equal to 1
geodesic_delete; %delete all meshes and algorithms
It prints out distances and then, in subsequent code, it plots the path.
So here's my problem. It prints out 12000+ distances corresponding to each of my "sources" but I only care about distances between 10 sources and 12 destinations on my mesh, given by vertices and faces. How can I get it to print the 120 distances I care about and store them in a matrix?