Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [1 -1 0; 1 1 0; 0 0 sqrt(2)]/sqrt(2);
err = x * your_fcn_name(x) - eye(3,3);
assert(norm(err) < 10*eps)
% Test for inv usage
pattern = '@inv|@pinv|inv\(|pinv\(';
fid = fopen(which('your_fcn_name'), 'r');
c = onCleanup(@()fclose(fid));
tline = fgetl(fid);
while ischar(tline),
if ~isempty(regexp(tline, pattern))
error('Don''t use inv() or pinv()');
end
tline = fgetl(fid);
end
|
1091 Solvers
9831 Solvers
201 Solvers
Change the first and last diagonal element of the identity matrix to zero
117 Solvers
Sum of the Multiplication of Vectors
202 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!