How to save normalized data set in file for using it again?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
tejasvee
il 27 Apr 2017
Commentato: tejasvee
il 29 Apr 2017
I have dataset in csv file. I have normalized it using
Data = rand(10, 20); % Test data, use your data instead
minData = min(Data(:));
maxData = max(Data(:));
scaled = (Data - minData) / (maxData - minData); % Scaled to [0, 1]
scaled = scaled * 2 - 1; % Scaled to [-1, 1]
now the data is normalized, i want to save the normalized data in file again like csv, txt etc.
1 Commento
Jan
il 28 Apr 2017
Do you see that the shown code is not relevant for your question? A scaled = rand(2,5) would be sufficient also.
Risposta accettata
Walter Roberson
il 27 Apr 2017
You could use save() or csvwrite() or dlmwrite() or xlswrite()
I would suggest saving as a binary .mat file unless you need it as text for another program.
6 Commenti
Walter Roberson
il 28 Apr 2017
save() does not save in csv form.
save dataset.txt scaled -ascii -double %text format but not commas
or
csvwrite('dataset.csv', scaled)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Text Files in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!