0

I have a dataset file called "data.mat", how can I store all the values in that into an array which I wanna name y or f(x) ?

The only thing I know is how to load it for example like this:

load('data.mat');
3
  • So what is the problem if you load the file and rename the variables, merge them or whatever you want to do? Alos f(x) is not a valid variable names, as brackets are not allowed. Commented Nov 8, 2016 at 18:46
  • so then I wanna nam it fx, but you dont get my point I'm not a Matlab professional, I want to store those values into an array which I call fx but I am not sure what is the simpliest way to do that? Commented Nov 8, 2016 at 18:51
  • 1
    after loading you can use the call the function whos and it will list all variable that are in you have. Say they are called a and b. Then you can simply do fx = a, if you want to store the values of a in a variable named fx. Commented Nov 8, 2016 at 19:06

1 Answer 1

1

This will load all the values in the MAT file into the struct s, which I think is the behavior you want:

s = load('data.mat');
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.