dataset

10 views (last 30 days)
Chiara Modenese
Chiara Modenese on 12 Apr 2011
Hello,
would you please give me an example of use of dataset? I am used to structures now, but I think that dataset could be easier to handle for my purposes. Say that I would like to see how dataset works having to import a simple txt data like:
a b c
1 2 3
4 5 6
7 8 9
Thanks for your example. Chiara

Answers (3)

Matt Tearle
Matt Tearle on 12 Apr 2011
x = dataset('file','simple.txt','delimiter',' ')
x.Properties.VarNames
x.a
plot(x.a,x.b,'o-')

the cyclist
the cyclist on 12 Apr 2011
Have you read the example in the documentation?
>> doc dataset

Chiara Modenese
Chiara Modenese on 12 Apr 2011
Thanks. Could you tell if it is also possible to create an array of dataset arrays? Having several files to deal with, I need to be able to write loops easily.
  3 Comments
Chiara Modenese
Chiara Modenese on 13 Apr 2011
Ok. I see the point, and in the end it turns out to be not so different from the use I do of structures. I was trying to make some comparisons between dataset and structures, to see pros and cons. In my case, I have data files with also different formatting so I may have different variables. Your suggestion is good though, thanks.
Oleg Komarov
Oleg Komarov on 13 Apr 2011
In general a DBMS is much better than MATLAB at managing data (dataset arrays try to emulate the functionalities of a database). In the long run I would invest time to learn SQL to manage data and interface it with MATLAB whenever computational complexity arises.
In my experience I started using only MATLAB and ended up executing 80% of descriptive statistical analysis with SQL Server!

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!