Error while evaluating uicontrol callback
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Not sure how to fix as I did not write this code, am just using it. When I press the button interpolate on my analyse control interface I get this message in matlab:
"Undefined function 'mex_interpolates_by_weight' for input arguments of type 'double'.
Error in analysis_callbacks (line 2130) map = mex_interpolates_by_weight(CDataStore, option); % mex_intepolates(save_filename, CDataArray)
Error while evaluating uicontrol Callback"
This is what comes up when I click the link to the line it is referring to:
map = mex_interpolates_by_weight(CDataStore, option); % mex_intepolates(save_filename, CDataArray)
And here is the code:
% Interpolate Button Pressed % Interpolate and make new summary image window else if option == 800
'Option 800 pressed'
mainHandle = 1; % The Analysis Control figure
viewHandle = findobj(mainHandle,'Tag', 'viewColor')
printHandle = findobj(mainHandle,'Tag', 'printColor')
% Find most recently accessed summary window by looking at the child windows of the main figure
childHandle = get(0, 'Children');
if length(childHandle) == 1;
errordlg('Please add a summary file', 'No Summary File Window');
return
end
count = 1;
name = get(childHandle(count), 'Name');
while ((count < length(childHandle)) & (~strcmp(name(length(name)-2:length(name)-1), 'su')))
count = count +1;
name = get(childHandle(count), 'Name');
end
set(findall(0, 'Pointer', 'arrow'), 'Pointer', 'watch');
figure(childHandle(count)); % Change to the most recently activated summary figure
mainHandle = gcf; % The summary figure
% if(~strcmp(name(length(name)-2:length(name)), 'su2')) % convert sum file to su2 file % analysis_callbacks(900, '.sum'); % save as a temp .su2 file % tmpTitle = get(mainHandle, 'Name'); % tmpTitle = [tmpTitle(1:end-4) '_qw21a_1' '.su2']; % return % else tmpTitle = get(mainHandle, 'Name'); % end
% Change the title to add in interp suffix
% winTitle_count = 1;
% for n = 1:length(tmpTitle) % add in an extra '\' so it is not read as a special character
% if(strcmp(tmpTitle(n), '\'))
% winTitle(winTitle_count) = '\';
% winTitle(winTitle_count+1) = '\';
% winTitle_count = winTitle_count + 2;
% else
% winTitle(winTitle_count) = tmpTitle(n);
% winTitle_count = winTitle_count + 1;
% end
% end
winTitle = tmpTitle;
% if(~strcmp(name(length(name)-2:length(name)), 'su2'))
% winTitle = strcat(winTitle(1:end-12), '_1_interp.su2');
% else
winTitle = strcat(winTitle(1:end-4), '_interp.su2');
% end
%Get the summary image handle and other details
summaryImageHandle = findobj(mainHandle, 'Tag', 'summaryImg');
CDataStore = get(summaryImageHandle, 'CData');
units = get(gca, 'UserData');
unitWidth = units(1);
unitTime = units(2);
unitHeight = units(3);
%Determine number of dropped frames
dropframecnt = 0;
CDataSize = size(CDataStore)
for cnt = CDataSize(1) : -1 : 1
if(CDataStore(cnt,1) == 0)
dropframecnt = dropframecnt + 1 ;
else
break;
end
end
if (dropframecnt > (length(CDataStore) * 0.02))
h = warndlg('More than 2% of the summary file consists of dropped frames\n Please process the .avi file through VirtualDub to remove the dropped frames.\n\n Note: The following interpolated file''s timescale is inaccurate!','WARNING!')
end
% command = ['interpolates ' '"' tmpTitle '" "' winTitle '"'] % result = system(command); % if(result) % command = [matlabroot '\interpolates ' '"' tmpTitle '" "' winTitle '"']; % result = system(command); % if(result) % command = [matlabroot '\analysis\interpolates ' '"' tmpTitle '" "' winTitle '"'] % result = system(command); % if(result) % command = [matlabroot '\analysis\min\interpolates ' '"' tmpTitle '" "' winTitle '"'] % result = system(command); % if(result) % command = [matlabroot '\min\interpolates ' '"' tmpTitle '" "' winTitle '"'] % result = system(command); % end % end % end % end
% map = zeros(mrows, ncols);
interpHandle = findobj(0, 'Tag', 'interp_by_weighted_mean');
if (strcmp(get(interpHandle, 'Checked'), 'on'))
option = 1;
else
option = 2;
end
map = mex_interpolates_by_weight(CDataStore, option); % mex_intepolates(save_filename, CDataArray)
if (strcmp(get(viewHandle, 'Checked'), 'on'))
if (strcmp(get(printHandle, 'Checked'), 'on'))
show(units, map, winTitle, 'default', 'default');
else
show(units, map, winTitle, 'default', 'gray');
end
else
if(strcmp(get(printHandle, 'Checked'), 'off'))
show(units, map, winTitle, 'gray', 'gray');
else
show(units, map, winTitle, 'gray', 'default');
end
end
% if(~strcmp(name(length(name)-2:length(name)), 'su2')) % system(['del "' tmpTitle '"']); % end % system(['del "' winTitle '"']); % end
set(findall(0, 'Pointer', 'watch'), 'Pointer', 'arrow')
0 comentarios
Respuesta aceptada
Walter Roberson
el 10 de Jun. de 2013
You need to locate the function mex_interpolates_by_weight
At the MATLAB command line, use the command
which -all mex_interpolates_by_weight
Considering the mex_ prefix I would not expect to see mex_interpolates_by_weight.m (unless it contained only documentation) but there might be a .c or .C or .cc or .cpp for it.
I suspect it did not get copied over from the original system when you brought over the code, but you could try using your system search function to look for file names that start with mex_interpolates_by_weight
I would, though, also suggest searching the code to look for loadlibrary() -- if it is there then the code for mex_interpolates_by_weight might be buried in a different source file and built into a library.
Más respuestas (0)
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!