필터 지우기
필터 지우기

How to save normalized data set in file for using it again?

조회 수: 2 (최근 30일)
tejasvee
tejasvee 2017년 4월 27일
댓글: tejasvee 2017년 4월 29일
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
Jan
Jan 2017년 4월 28일
Do you see that the shown code is not relevant for your question? A scaled = rand(2,5) would be sufficient also.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2017년 4월 27일
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
Walter Roberson
Walter Roberson 2017년 4월 28일
save() does not save in csv form.
save dataset.txt scaled -ascii -double %text format but not commas
or
csvwrite('dataset.csv', scaled)
tejasvee
tejasvee 2017년 4월 29일
Thanks it was helpful and it worked.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by