Skip to content
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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

mabhijithn
Copy link
Owner

No description provided.

@servaasvdc servaasvdc self-requested a review October 30, 2019 14:10
channel_select.m Outdated
Comment on lines 58 to 63
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
Copy link
Collaborator

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)

Copy link
Collaborator

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

Copy link
Collaborator

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.

grputilcalc.m Show resolved Hide resolved
grputilcalc.m Show resolved Hide resolved
Comment on lines +21 to +29
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);
Copy link
Collaborator

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

Copy link
Collaborator

@servaasvdc servaasvdc left a 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

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.

2 participants