-
Notifications
You must be signed in to change notification settings - Fork 1
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
Utility computation when: custom group sizes and columns in a group. #1
base: master
Are you sure you want to change the base?
Conversation
channel_select.m
Outdated
case 'groupid' | ||
grpid = Value; | ||
nofuniq = unique(grpid); % Number of unique groups | ||
if(size(grpid,1)~=size(A,2)) | ||
error('Length of group-ids != No.of columns in A'); | ||
end |
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.
Consider using inputParser for all this argument processing stuff
grputilcalc.m
Outdated
% columns of data with each entry containing the group ID that the | ||
% corresponding column in A belongs to. | ||
function util = grputilcalc (RXXinv, W, grpid) | ||
|
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.
Have a look at https://nl.mathworks.com/help/matlab/matlab_prog/add-help-for-your-program.html for info on how to document a function. help grputilcalc
will look probably look whack like this
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.
Apart from the formatting, some examples would be great as well. See also https://nl.mathworks.com/matlabcentral/fileexchange/46056-matlab-style-guidelines-2-0 -- great guide.
indx = (grpid==uniqgrps(k)); | ||
|
||
% Select decoder weights of group k | ||
Wkq = W(indx); | ||
|
||
% utility computation of group k | ||
S = RXXinv(indx,indx); | ||
|
||
util(k) = Wkq'*(S\Wkq); |
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.
Looks okay but you could probably do this in a single line with splitapply, where grpid
is the grouping variable
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.
Looks okay for now. Lemme know if there's anything else you want me to take a look at
…channel-selection now in group-ID format
- Changed lambda selection to minimum positive eigen value; to match with the theory in paper
No description provided.