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?
Kshitij Singh answered .
2025-11-20
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