-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix edge case in marker value import #768
Conversation
end | ||
|
||
% for loops are faster than arrayfun | ||
n = numel(S); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing code:
field = 'f';
value = {'some text','a';
[10, 20, 30],'b';
magic(5),3};
S = struct(field,value);
v = pspm_struct2vec(S, 'f')
Fixes #727, an edge case reported in #719.
Changes proposed in this pull request:
[S(:).field]
for cases in whichnumel(S(i).field) ~= 1
in a new functionpspm_struct2vec
markerinfos.values
being char rather than num.