Cody

Problem 44891. Invert a 3D rigid-body transformation

Solution 1805790

Submitted on 4 May 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = [ 0 0 -1 2 1 0 0 3 0 -1 0 4 0 0 0 1]; err = x * your_fcn_name(x) - eye(4,4); assert(sum(sum(abs(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

Index in position 2 is invalid. Array indices must be positive integers or logical values. Error in your_fcn_name (line 4) y(1:3,4) = -x(1:3,1.3).'*x(1:3,4); Error in Test1 (line 6) err = x * your_fcn_name(x) - eye(4,4);