Vikrant Karale
Vikrant Karale

Reputation: 147

'load' function unable to load mat file in a specified variable

I wanted to load a file 'data_MC_temp.mat' into a variable 'data_MC'. I tried using following command: load('data_MC_temp.mat', 'data_MC');

But, MATLAB neither loads file into 'data_MC' variable nor gives any error or warning. Is there anything wrong with the syntax? Please help me and suggest proper way of doing it.

Upvotes: 0

Views: 191

Answers (1)

Ghaul
Ghaul

Reputation: 3330

To load a file into a variable do like this:

data_MC = load('data_MC_temp.mat');

The syntax you used is only used if there is a variable insde the file data_MC_temp.mat called data_MC and you only want to load that specific variable.

Upvotes: 4

Related Questions