28 views (last 30 days)
Giovanni Sartori on 25 Aug 2020
Edited: Ciro Bermudez on 7 Dec 2021
I'm doing the MATLAB Onramp as a refresher, and I have found a very interesting exercise on music chords, frequencies and Fourier Transform (10.2 Project). I would like to experiment on this using my desktop installation of MATLAB, but I need the "Cchord.mat" file. Is it available for download and personal use?
GS
##### 2 CommentsShowHide 1 older comment
Giovanni Sartori on 19 Nov 2020
You have to load the Cchord.mat file (it can be done as early as Task 1) in Onramp. Then you bring up the Command Window (at the bottom of the screen; drag it upwards as to enlarge it), and simply type "y". This way, you are "printing" in the Command Window all of the values contained in the variabile "y". Then you can CTRL+A to select everything, and paste it wherever you like.
Beware: you will have to do a lot of tidying up before you can use the data.

Shiva Katukam on 27 Aug 2020
Direct download or saving the mat file is not supported. But you can still create a new mat file and copy the variables from the mat file you wish to download.
##### 2 CommentsShowHide 1 older comment
Kyle Sieracki on 19 Nov 2020
Can you post the a link/download of the data for Cchord.mat. I'm trying to do what you did and I can't figure it out

Ciro Bermudez on 19 Nov 2021
Edited: Ciro Bermudez on 7 Dec 2021
I extracted the "Cchord.mat" using the following code:
clear; clc;
for i = 1:3072
fprintf("%1.32f\n",y(i));
end
% 1 3072
% 3073 6144
% 6145 9216
% 9217 12288
you need to change the limits of the for cycle four times, copy and paste the result in notepad++ or sublime text, then save the file as "data.csv".
Note: to easily copy the result just select the first line, then press and hold the shift key, with the mouse move to the end and click at the end of the last line.
Finally use the following code in your desktop matlab to save a ".mat" file
clear; clc;
format long;
fs = 8192;
save Cchord.mat;
Remember thar the ".csv" should be in the same directory you are working on, hope it helps.
Giovanni Sartori on 20 Nov 2021
Thank you for your answer. I already managed to extract the values I needed, but I hope that your solution will help other people.

R2020a

### Community Treasure Hunt

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

Start Hunting!

Translated by