Created
November 2, 2017 19:37
-
-
Save iamharshit/6776f78841ae7d9b055e512576f519ac to your computer and use it in GitHub Desktop.
generates a csv file containing data(x,f(x)) which is used for training neural nets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generate_data() | |
if exist('data_harshit.csv', 'file') == 2 | |
delete data_harshit.csv; | |
end | |
x=[-1000:20:1000]; | |
y=f(x); | |
ans=vertcat(x,y)'; | |
csvwrite('data_harshit.csv',['x','y']); | |
dlmwrite('data_harshit.csv',ans,'delimiter',',','-append'); | |
function a=f(x) | |
a=2*x; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment