Undefined function or variable

Hello I am trying to use "newest8_short" to normalize MRI data. I added in my "SPM8" folder in the "Set Path" function, but I continue to get this error: >> newest8_short Undefined function or variable 'newest8_short'.

3 Comments

Hi Alyssa,
after you get the error, if you type 'path' does SPM8 appear in the list? And when you used Set Path, if you wanted the addition to be permanent, did you hit the 'Save' button?
Hi David, Yes, 'C:\Users\bdl105_03\Documents\fieldtrip-20160814\external\spm8' appears on the list, and I did hit save after setting the path.
I was going under the assumption that newest8_short.m is contained in spm8, in which case
which newest8_short
should result in
long path name ...\newest8_short.m

Sign in to comment.

 Accepted Answer

I checked the spm8 source code at https://github.com/canlab/spm8 and find that newest8_short is not part of spm8.
The only reference to newest8_short I can find anywhere is a message that you yourself posted at https://www.nitrc.org/forum/forum.php?set=custom&forum_id=1144&style=nested&max_rows=25 which shows that newest8_short is calling upon spm routines. But the traceback also makes clear that newest8_short was called: otherwise you would not get the error message
Error in newest8_short>generate_slice_mosaic (line 323)
So it appears that newest8_short might be your own routine, and that you have stored it somewhere but not put that directory on your MATLAB path, and that you then changed directories.

2 Comments

I figured out that problem, but now that I have re-identified newest8_short I am running back into the error previously mentioned:
Error using spm_vol>subfunc (line 103)
File "T1_MNI.nii" does not exist.
Error in spm_vol>subfunc1 (line 77)
v = subfunc(P(i,:));
Error in spm_vol>subfunc2 (line 69)
V = subfunc1(P);
Error in spm_vol (line 54)
V = subfunc2(P);
Error in newest8_short>generate_slice_mosaic (line 323)
Vi = spm_vol(img_name);
Error in newest8_short (line 97)
generate_slice_mosaic( 'T1_MNI.nii' , orientation )
That seems fairly clear. You have asked to open T1_MNI.nii from somewhere on your MATLAB path, but there is no file by that name on your MATLAB path. I suggest you double-check for the difference between 1 (one) and l (lower-case L) and I (upper case I)

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!