Question
function D1=TEST() D=readtable('test.txt','delimiter',','); save canc.tset D D1=load('canc.tset',"-mat") end i access it using D1.D... it's possibile to avoid "D" field?
Related Questions
Expert Answer
Kshitij Singh
PhD Expert
Answered Aug 14, 2026
If there is only one variable in the MAT file (regardless of its extension) and you do not know/care what its name is:
C = struct2cell(load(..));
assert(isscalar(C),'Only one array can be LOADed')
T = C{1}
If the variable name is known in advance, e.g. "D"
S = load(..) T = S.D
Have a different question? Ask here