MATLAB: Load variable from mat file

loadmat

Hello,
I have a mat file containing 4 variables. For some reasons, I would like to load only of these 4 variables (let's say Y). How can I load it without loading the 3 others ?

Best Answer

S = load('YourFileName', 'Y');
Y = S.Y;