fix edge case in marker value import#768
Merged
dominikbach merged 6 commits intodevelopfrom Sep 4, 2024
Merged
Conversation
teddphil
reviewed
Sep 4, 2024
| end | ||
|
|
||
| % for loops are faster than arrayfun | ||
| n = numel(S); |
There was a problem hiding this comment.
I tested this function with two-dimensional structure array, and I can see it works well with this function. The only thing is, this function will provide a 1xN vector v, where N denotes the number of elements in the structure array. If it is a two dimensional structure array with size p x q, the output will be 1 x p*q vector. If this is expected, I can merge this PR directly. Thank you.
There was a problem hiding this comment.
Testing code:
field = 'f';
value = {'some text','a';
[10, 20, 30],'b';
magic(5),3};
S = struct(field,value);
v = pspm_struct2vec(S, 'f')
teddphil
approved these changes
Sep 4, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #727, an edge case reported in #719.
Changes proposed in this pull request:
[S(:).field]for cases in whichnumel(S(i).field) ~= 1in a new functionpspm_struct2vecmarkerinfos.valuesbeing char rather than num.