Matlab 与mex文件关联的未定义函数
我正在使用一个Matlab代码(不是我自己开发的),它调用一个与mex文件相关联的函数(它们有相同的名词)。但是,我得到一个错误,指出函数未定义 在调用此函数之前是否应执行指定的命令?(我使用的是MAC OS X和Matlab R 2016a) 下面是代码,错误在调用函数fastmarchmex的行上(我记得fastmarchmex.mexw64和32在当前文件夹中):Matlab 与mex文件关联的未定义函数,matlab,mex,Matlab,Mex,我正在使用一个Matlab代码(不是我自己开发的),它调用一个与mex文件相关联的函数(它们有相同的名词)。但是,我得到一个错误,指出函数未定义 在调用此函数之前是否应执行指定的命令?(我使用的是MAC OS X和Matlab R 2016a) 下面是代码,错误在调用函数fastmarchmex的行上(我记得fastmarchmex.mexw64和32在当前文件夹中): 因此,您应该为Mac重新编译Mex文件,现在您有Windows版本了函数和Mex文件在您的中还是在您的中?是的,当然是文件。
因此,您应该为Mac重新编译Mex文件,现在您有Windows版本了函数和Mex文件在您的中还是在您的中?是的,当然是文件。调用与Mex文件(functionmex.mexw64)关联的函数(function)的m位于同一个当前文件夹“我正在使用Matlab代码”中。您如何使用它?如果你不在问题中包含你的代码,这很难帮助你。请务必包含您的代码。我编辑了帖子,但没有生成mex文件的源代码。我将切换到linux,看看它是否有效。非常感谢。你应该试试Windows。这些Mex文件是为OSOn Linux Ubuntu编译的,我得到一个错误:输入参数类型为“int64”的未定义函数“fastmarchmex”。这看起来很奇怪,因为我的目录中既有fastmarchmex.mexw64,也有fastmarchmex.mexw32。这是针对Windows的,而且只针对Windows。好吧,对不起,我不明白这只针对Windows。我要试试窗户
rootdir = fileparts(mfilename('fullpath'));
addpath(fullfile(rootdir,'util'));
addpath(fullfile(rootdir,'sihks'));
load(fullfile(rootdir,'shapes','0001.scale.1.mat'),'shape'
%%-------------------------------------------------------------------
%% SIHKS signature
%%-------------------------------------------------------------------
fprintf('preprocessing');
shape.idxs = compute_vertex_face_ring(shape.TRIV');
ndesc = 5;
[desc,shape] = signature(shape,'sihks');
fprintf('.');
%%-------------------------------------------------------------------
%% ISC settings
%%-------------------------------------------------------------------
rad = 10; % radius used for descriptor construction
nbinsr = 5; % number of rings
nbinsth = 16; % number of rays
rr = [1:nbinsr]/nbinsr*rad;
th = [1:nbinsth]/nbinsth*2*pi;
fhs = 2; %% factor determining hardness of scale
quantization
fha = .01; %% factors determining hardness of angle
quantization
**shape.f_dns = fastmarchmex('init', int32(shape.TRIV-1),
double(shape.X(:)), double(shape.Y(:)), double(shape.Z(:)));**
vertex = 701;
shape =
fast_marching(vertex,shape,'vertex',0,1,shape.f_dns);
[in_ray,in_ring,shp,geod,directions]= get_net(shape,vertex,'scales',
[0,rr],'N_rays',length(th),'fhs',fhs,'fha',fha);
[dec_net] = get_descriptor_from_net(in_ray,in_ring,desc,shape.Av);
fastmarchmex('deinit', shape.f_dns);
%% end of code, visualization of results
a = -82.5000;
v = 18;
dind = 1;
figure(1); clf; show_shape(shape,desc(:,dind));
hold on,scatter3(geod{1}(1,1),geod{1}(2,1),geod{1}
(3,1),'filled','SizeData',150,'Cdata',[1,0,0])
for k=[1:length(geod)]
hold on;
h = plot3(geod{k}(1,:),geod{k}(2,:),geod{k}(3,:));
set(h,'Color',[0 0 0],'LineWidth',2);
end
for r = [1:length(rr)]
plot_ring(shape,rr(r));
end
title('Net around vertex')
view(-82.50,18)
figure(2); clf; plot_polarhist(squeeze(desc_net(dind,:,:)),rr,th,0);