Need to load a file from an open data set a

I HATE this system.
All I want to do is load the opensource data file and it won't do anything, doesn't list anything I can load, the fundamentals instructions are useless its just sending me round in circles. Right now I am close to throwing the computer against a wall.

4 Comments

keep calm
can you share the data file and describe what you want to do with it
I completely understand! MATLAB is relatively straightforward to use, however like everything else, it takes a bit of time to learn how to use it efficiently.
It is difficult to determine what the problem is from your description, however I get the impression that you’re having problems finding and reading a .csv file.
It’s easier to work with files in your MATLAB user path (see What Is the MATLAB Search Path?), however that is not absolutely necessary. If you know the file path, use the fullfile function to create the complete path to it. (In Windows systems, you can find that information using File Explorer, and right-clicking on the file icon, click on ‘Properties’ and copy and paste the necessary data to the fullfile argument fields in the MATLAB Editor.)
Then use either readmatrix (or readtable) to read the file.
Please describe the problems you’re having in some detail. We can help.
"C:\Users\Joyfu\Downloads\SOCR-HeightWeight.csv"
It is an open source data file that I am needing to analyse. This is the first time I have used Matlab to do this analysis. I have gone through the tutorials but when I use the same instructions it does not work.
Thank you Star Strider. I had figured out how to load the data onto a desktop installation of MATLAB before I read your comment but your comment has lead me to more information which is what I needed. I am a first time user so I was looking at the syntax for load and readtable and wondering what on earth I was missing. Obviously, I was in the wrong area of the help pages.
Mathieu NOE thanks for your kind intentions. However, has anyone - in the history of time - ever calmed down, when being told "calm down"? :-) Please don't ever use that particular expression in the middle of a bar fight! ;-)

Sign in to comment.

 Accepted Answer

Perhaps something like this:
file = "C:\Users\Joyfu\Downloads\SOCR-HeightWeight.csv";
A = readmatrix(file)
Col1 = A(:,1); % First Column
Using readtable will also show any header information, if there are any headers in the file (some .csv files have a header line):
T = readtable(file, 'VariableNamingRule','preserve')
Col1 = T{:,1}; % First Column
Col2 = T{:,2}; % Second Column
If you use readtable, see Access Data in Tables for more information on how to use them, since this is not immediately obvious.
.

1 Comment

As always, my pleasure!
Also, as a physician, I would never suggest (and have never suggested) that a person ‘calm down’. It is important to validate the person’s very real emotions, understand the problem, and then do my best to help the person solve the problem.
.

Sign in to comment.

More Answers (0)

Asked:

Joy
on 11 Jul 2023

Commented:

on 12 Jul 2023

Community Treasure Hunt

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

Start Hunting!