matlab运行C程序

求一位指导下为什么以下C代码在matlab中运行不出来(插件也下载了,找不到哪错了)有偿也可


include 
include 
include                    

define MAX_VERTICES 100 // 停车位数量
define MAX_EDGES 1000 // 路径数量

typedef struct {
    int x; %停车位横坐标
    int y; %// 停车位纵坐标
} Vertex;

typedef struct {
    int source; %// 路径起点
    int destination; %// 路径终点
    int weight; %// 路径长度
} Edge;

Vertex vertices[MAX_VERTICES]; %// 停车位坐标
Edge edges[MAX_EDGES]; %// 所有路径

int num_vertices = 0; %// 停车位数量
int num_edges = 0; %// 路径数量

int distances[MAX_VERTICES]; %// 距离
int visited[MAX_VERTICES]; %// 是否访问过
int previous[MAX_VERTICES]; %// 前一个节点

int find_shortest_path(int source, int destination);
void initialize_distances(int source);
int get_closest_unvisited_vertex();
void dijkstra(int source);

int main() {
    %// 输入停车位坐标
    printf("请输入停车位数量:");
    scanf_s("%d", &num_vertices);
    printf("请输入每个停车位的坐标(x y):\n");
    for (int i = 0; i < num_vertices; i++) {
        scanf_s("%d %d", &vertices[i].x, &vertices[i].y);
    }

    %// 输入路径
    printf("请输入路径数量:");
    scanf_s("%d", &num_edges);
    printf("请输入每条路径的起点、终点和长度:\n");
    for (int i = 0; i < num_edges; i++) {
        scanf_s("%d %d %d", &edges[i].source, &edges[i].destination, &edges[i].weight);
    }

    %// 输入停车位编号,计算到最近出口和最近电梯口的距离
    int parking_spot;
    printf("请输入停车位编号:");
    scanf_s("%d", &parking_spot);
    int exit_distance = find_shortest_path(parking_spot, 0);
    int elevator_distance = find_shortest_path(parking_spot, num_vertices - 1);

    %// 输出结果
    printf("停车位 %d 到最近出口的距离为 %d,到最近电梯口的距离为 %d。\n", parking_spot, exit_distance, elevator_distance);

    return 0;
}

%// 查找从 source 到 destination 的最短路径长度
int find_shortest_path(int source, int destination) {
    initialize_distances(source);
    dijkstra(source);
    return distances[destination];
}

%// 初始化距离数组
void initialize_distances(int source) {
    for (int i = 0; i < num_vertices; i++) {
        if (i == source) {
            distances[i] = 0;
        } else {
            distances[i] = INT_MAX;
        }
        visited[i] = 0;
        previous[i] = -1;
    }
}

%// 获取距离 source 最近且未访问过的顶点
int get_closest_unvisited_vertex(int source) {
    int closest_vertex = -1;
    int closest_distance = INT_MAX;
    for (int i = 0; i < num_vertices; i++) {
        if (!visited[i] && distances[i] < closest_distance) {
            closest_vertex = i;
            closest_distance = distances[i];
        }
    }
    return closest_vertex;
}

%// 运用迪杰斯特拉算法计算最短路径
void dijkstra(int source) {
    for (int i = 0; i < num_vertices; i++) {
        int current_vertex = get_closest_unvisited_vertex(source);
        visited[current_vertex] = 1;
        for (int j = 0; j < num_edges; j++) {
            if (edges[j].source == current_vertex) {
                int neighbor = edges[j].destination;
                int distance = edges[j].weight;
                if (distances[current_vertex] + distance < distances[neighbor]) {
                    distances[neighbor] = distances[current_vertex] + distance;
                    previous[neighbor] = current_vertex;
                }
            }
        }
    }
}

环境变量配置了吗??