Error while evaluating uicontrol callback
显示 更早的评论
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 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!