Skip to content

Commit de30613

Browse files
HanSur94claude
andcommitted
fix: ensure direction is char array before passing to binary_search MEX
Octave can pass string objects instead of char arrays in certain contexts, causing the MEX input validation to reject them. Wrapping with char() ensures compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3fa33a0 commit de30613

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

libs/FastPlot/binary_search.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
% Delegate to MEX for speed when available
5050
if useMex
51-
idx = binary_search_mex(x, val, direction);
51+
idx = binary_search_mex(x, val, char(direction));
5252
return;
5353
end
5454

libs/FastPlot/private/binary_search.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
% Fast path: MEX implementation
4646
if useMex
47-
idx = binary_search_mex(x, val, direction);
47+
idx = binary_search_mex(x, val, char(direction));
4848
return;
4949
end
5050

0 commit comments

Comments
 (0)