Skip to content

Commit ac46741

Browse files
authored
Merge pull request #5 from nigelrogasch/nick_edits
Nick edits to remove instrhwinfo dependence in magstim.m
2 parents 22c2953 + c0722cf commit ac46741

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

magstim.m

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,12 @@
2020
methods
2121
function self = magstim(PortID)
2222
% 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-
23+
2824
%% Check Input Validity:
2925
narginchk(1, 1);
30-
if ~ischar(PortID) || (~isstring(PortID) && (numel(PortID) == 1))
26+
if ~ischar(PortID) || (exist('string','class') && ~isstring(PortID) && (numel(PortID) == 1))
3127
error('The serial port ID must be a character or string array.');
3228
end
33-
if ~any(strcmp(listOfComPorts, PortID))
34-
error('Serial com port ID not found.');
35-
end
3629

3730
self.portID = PortID;
3831
end

0 commit comments

Comments
 (0)