Converting time and velocity to frequency then plotting
Show older comments
I'm trying to extract data from a ".csv" file but want it to be two specific columns and start at a specific row (until the end of those columns) then use that data to convert it to frequency then plot that.
I have been given time and velocity (vertical).
7 Comments
Enrico Gambini
on 16 Feb 2022
Can you post a screenshot of your spreadsheet, in order to see it clearly
Julie Huynh
on 16 Feb 2022
Edited: Julie Huynh
on 16 Feb 2022
Enrico Gambini
on 16 Feb 2022
In order to read the table starting from the i-th column you can do the following
i=4; %you can change here the row from which you'd like to start reading the file
options=detectImportOptions(filename, 'NumHeaderLines',i);
Table=readtable(filename,opts); %read the table
Then I don't know how to convert the 3 velocities + time into a frequency, do you have an equation to do so or something?
Julie Huynh
on 16 Feb 2022
Enrico Gambini
on 16 Feb 2022
Hence, you need only the vector v0? Right?
Julie Huynh
on 16 Feb 2022
Edited: Julie Huynh
on 16 Feb 2022
Jon
on 16 Feb 2022
Not sure what you mean by convert velocities to frequencies but regarding bringing the data into MATLAB I would suggest in general you are better off using MATLAB's readtable function. You can get details on using that by typing doc readtable on the command line. This will give you the data in a table and you can get individual columns using the column names using dot notation. So for example
dat = reatable('myfile.csv')
vBar = mean(dat.v0); % for example compute the mean of the column named v0
If your column names are not valid MATLAB variable names then they will by default automatically renamed, so for example spaces in the names will be given underscores.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!