Start with the method file (see https://osabrainresearch.atlassian.net/wiki/pages/resumedraft.action?draftId=1541439489 )
Copy the directions
Paste into Notepad and save as text file
Include extension, so “D.txt”
In MATLAB, “Import Data” and select file
Check “Space” under Column delimiters
Change “Output Type” to “Numeric Matrix”
Import (by default all columns should be selected)
Variable will take name of file (e.g., “D”)
In MATLAB Command Window, rearrange the imported variable into rows of x/y/z
Code Block | ||
---|---|---|
| ||
% Transpose
D = D';
% Get rid of NaN's at end
D(isnan(D)) = [];
% Reshape into x/y/z (columns)
D = reshape(D,3,[]);
% Flip so xyz are in rows
D = D'; |
Copy directions
Paste into Notepad and save as text file *e.g., “D.txt”)
Import