Skip to content

DAiSS: bf_output_image_mv.m custom-design branch errors with "Unrecognized function or variable 'contrast'" #126

Description

@olivercase

In toolbox/DAiSS/bf_output_image_mv.m, the custom branch of S.isdesign builds the design matrix X but never initialises contrast. The size check at line ~332

if size(contrast,1) ~= size(X,2),                                                                                                                                                                                                    
    error('contrast needs to match number of columns in design');                                                                                                                                                                    
end        

Then errors with Unrecognised function or variable 'contrast'. The sibling design-from-file branch already defaults contrast = eye(size(X,2)) when the loaded design has no contrast field (line ~308). The custom branch is missing the equivalent initialiser.

Proposed fix

Mirror the design-file branch default: after the custom branch builds X and before the size-check, add

contrast = eye(size(X,2));

The minimal patch (against current main) goes at the end of the if isfield(S.isdesign,'custom') block, just before the else %% conditions and contrast specified in a file branch (around line 283 in the current source).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions