Not enough input arguments.

Hi everyone,
I am trying to use Matlab to transform MNI coordinates in to Talaraich coordinates using the following function (found here: http://imaging.mrc-cbu.cam.ac.uk/imaging/MniTalairach#Approach_1:_redo_the_affine_transform):
function outpoint = aff_mni2tal(inpoint)
Tfrm = [0.88 0 0 -0.8;0 0.97 0 -3.32; 0 0.05 0.88 -0.44;0 0 0 1];
tmp = Tfrm * [inpoint 1];
outpoint = tmp(1:3);
I have saved the function and added it to the file path. The problem arises when I try and enter MNI coordinates:
aff_mni2tal( [10 12 14] )
I get the following error message:
Error using * Inner matrix dimensions must agree. Error in aff_mni2tal (line 3) tmp = Tfrm * [inpoint 1];

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 11월 15일
편집: Azzi Abdelmalek 2013년 11월 15일

0 개 추천

You have to use multiplication element by element .* instead of *
function outpoint = aff_mni2tal(inpoint)
Tfrm = [0.88 0 0 -0.8;0 0.97 0 -3.32; 0 0.05 0.88 -0.44;0 0 0 1];
tmp = Tfrm .* [inpoint 1];
outpoint = tmp(1:3);
Image Analyst
Image Analyst 2013년 11월 15일

0 개 추천

Tfrm is 4x4. [inpoint 1] is a by 4. You can't do a matrix multiplication of 4x4*1x4. Perhaps you meant to do a 4 by 1: [inpoint 1]'. The ' transposes the array.

이 질문은 마감되었습니다.

질문:

2013년 11월 15일

마감:

2021년 8월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by