Not enough input arguments.
Informazioni
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Mostra commenti meno recenti
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];
Risposte (2)
Azzi Abdelmalek
il 15 Nov 2013
Modificato: Azzi Abdelmalek
il 15 Nov 2013
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
il 15 Nov 2013
0 voti
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.
Questa domanda è chiusa.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!