0

I'm try to load a some variables ( matrix,number ...) from a file .dat, but when I try to load I get the mistake load: failed to read matrix from file.

this is the main file

function resultado = batallaNaval()
   init();
end

function resultado =init()
  load historial.dat;
  jugadas = historial() 
end 

The code the file historial.dat is:

a=[1 1 ;2 1; 3  0; 4  7];
numberBoats= 5;

which is the correct form to load the variables?

0

1 Answer 1

1

I think you want to do this instead

load('historial.dat', '-mat');

This tells MATLAB it's in the .mat file format, even though it doesn't have the right extension.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.