We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 22c2953 + c0722cf commit ac46741Copy full SHA for ac46741
1 file changed
magstim.m
@@ -20,19 +20,12 @@
20
methods
21
function self = magstim(PortID)
22
% PortID <char> defines the serail port id on your computer
23
-
24
- %% Find All Available Serial Ports On Your Computer
25
- foundPorts = instrhwinfo('serial');
26
- listOfComPorts = foundPorts.AvailableSerialPorts;
27
+
28
%% Check Input Validity:
29
narginchk(1, 1);
30
- if ~ischar(PortID) || (~isstring(PortID) && (numel(PortID) == 1))
+ if ~ischar(PortID) || (exist('string','class') && ~isstring(PortID) && (numel(PortID) == 1))
31
error('The serial port ID must be a character or string array.');
32
end
33
- if ~any(strcmp(listOfComPorts, PortID))
34
- error('Serial com port ID not found.');
35
- end
36
37
self.portID = PortID;
38
0 commit comments