-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIntro.m
54 lines (39 loc) · 1.3 KB
/
Intro.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function [ ] = Intro( )
%INTRO Summary of this function goes here
% Detailed explanation goes here
%% Clear and clean everything first
clc; % Clear Command Window
close all % Remove specified figure
%% Introduce the function
fprintf('This function will determine texture characteristics. \nIt requires the Image Processing Toolbox.\n \n');
%% Change the current folder to the folder of this m-file
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
%% Show versions and user's toolboxes
fprintf('Checking for Image processing toolbox...\n \n');
v = ver;
for k=1:length(v)
if strfind(v(k).Name, 'Image Processing')
fprintf('%s, Version %s \n', ...
v(k).Name, v(k).Version)
end
end
%% Check if user has the Image Processing Toolbox installed.
versionInfo = ver; % Capture their toolboxes in the variable.
hasIPT = false;
for k = 1:length(versionInfo)
if strcmpi(versionInfo(k).Name, 'Image Processing Toolbox') > 0
hasIPT = true;
end
end
if ~hasIPT
% No toolbox installed.
message = sprintf('Sorry, but it looks like you do not have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
if strcmpi(reply, 'No')
% User' decision to exit:
return;
end
end
end