Skip to content

Fixing ambiguous match bug in importcarto_mem.m#91

Open
FilippoUslenghi wants to merge 2 commits into
openep:feature/newfilestructurefrom
FilippoUslenghi:feature/newfilestructure
Open

Fixing ambiguous match bug in importcarto_mem.m#91
FilippoUslenghi wants to merge 2 commits into
openep:feature/newfilestructurefrom
FilippoUslenghi:feature/newfilestructure

Conversation

@FilippoUslenghi

@FilippoUslenghi FilippoUslenghi commented May 12, 2026

Copy link
Copy Markdown

This pull request updates importcarto_mem.m in two places.

First, it changes the map-name matching logic to use exact, case-insensitive string matching when identifying the selected Carto map.
Previously, map names were matched using strstartcmpi, which could return multiple matches when another map name started with the same characters as the selected map. For example, if a study contained maps named "2-LA" and "2-LA something", selecting "2-LA" would match both entries.
This would cause the following error at line 241 map.name = cartoMap.ATTRIBUTE.Name;:

Intermediate dot '.' indexing produced a comma-separated list with 2 values, but it must produce a single value when followed by subsequent indexing operations.

The change replaces strstartcmpi with strcmpi, ensuring that only exact map-name matches are returned while preserving case-insensitive comparison. This keeps the behavior consistent with the intended single-match logic in lines 214-217.

Second, it updates the save call at line 749 has been updated to use the -v7.3 MAT-file format, as in line 760.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant