Skip to content

Commit a1db3f1

Browse files
authored
Use erase instead of strrep (#238)
1 parent 7b557d8 commit a1db3f1

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

+eui/ConditionPanel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function onEdit(obj, src, eventData)
105105
% See also FILLCONDITIONTABLE, EUI.PARAMEDITOR/UPDATE
106106
row = eventData.Indices(1);
107107
col = eventData.Indices(2);
108-
assert(all(cellfun(@strcmpi, strrep(obj.ConditionTable.ColumnName, ' ', ''), ...
108+
assert(all(cellfun(@strcmpi, erase(obj.ConditionTable.ColumnName, ' '), ...
109109
obj.ParamEditor.Parameters.TrialSpecificNames)), 'Unexpected condition names')
110110
paramName = obj.ParamEditor.Parameters.TrialSpecificNames{col};
111111
newValue = obj.ParamEditor.update(paramName, eventData.NewData, row);

addRigboxPaths.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function addRigboxPaths(varargin)
5656
% computer only)
5757
isInstalled = strcmp('GUI Layout Toolbox', {toolboxes.Name});
5858
if ~any(isInstalled) ||...
59-
str2double(strrep(toolboxes(isInstalled).Version,'.', '')) < 230
59+
str2double(erase(toolboxes(isInstalled).Version,'.')) < 230
6060
warning('Rigbox:setup:toolboxRequired',...
6161
['MC requires GUI Layout Toolbox v2.3 or higher to be installed. '...
6262
'Click <a href="matlab:web(''%s'',''-browser'')">here</a> to install.'],...

tests/ParamEditor_test.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ function test_paramEdits(testCase)
456456
testCase.verifyEqual(gLabels(idx).ForegroundColor, [1 0 0], ...
457457
'Unexpected label colour')
458458
% Verify change in underlying param struct
459-
par = strcmpi(PE.Parameters.GlobalNames, strrep(gLabels(idx).String, ' ', ''));
459+
par = strcmpi(PE.Parameters.GlobalNames, erase(gLabels(idx).String, ' '));
460460
testCase.verifyEqual(PE.Parameters.Struct.(PE.Parameters.GlobalNames{par}), 666, ...
461461
'UI edit failed to update parameters struct')
462462
% Verify Changed event triggered
@@ -476,7 +476,7 @@ function test_paramEdits(testCase)
476476
testCase.verifyEqual(gLabels(idx).ForegroundColor, [1 0 0], ...
477477
'Unexpected label colour')
478478
% Verify change in underlying param struct
479-
par = strcmpi(PE.Parameters.GlobalNames, strrep(gLabels(idx).String, ' ', ''));
479+
par = strcmpi(PE.Parameters.GlobalNames, erase(gLabels(idx).String, ' '));
480480
testCase.verifyEqual(...
481481
PE.Parameters.Struct.(PE.Parameters.GlobalNames{par}), gInputs(idx).Value==true, ...
482482
'UI checkbox failed to update parameters struct')

tests/checkCoverage.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
narginchk(1,2)
2020
if nargin == 1
2121
% Try to divine test function location
22-
funLoc = fileparts(which(strrep(testFile,'_test','')));
22+
funLoc = fileparts(which(erase(testFile,'_test')));
2323
end
2424
import matlab.unittest.TestRunner
2525
import matlab.unittest.plugins.CodeCoveragePlugin

tests/optimizations/ParamEditor_perfTest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function test_paramEdits(testCase)
231231
'Unexpected label colour')
232232
% Verify change in underlying param struct
233233
par = strcmpi(PE.Parameters.GlobalNames,...
234-
strrep(gLabels(idx).String, ' ', ''));
234+
erase(gLabels(idx).String, ' '));
235235
testCase.verifyEqual(PE.Parameters.Struct.(PE.Parameters.GlobalNames{par}), 666, ...
236236
'UI edit failed to update parameters struct')
237237

0 commit comments

Comments
 (0)