using imported txt file in neural network

1 view (last 30 days)
Reham Mahmoud
Reham Mahmoud on 22 Sep 2020
Edited: Ameer Hamza on 22 Sep 2020
i imported txt file data in workspace to copy from it and past in the editor as :
x=[120 240 480 960 1920 ];
that what i want; but actually the numbers appears with many zeros and separated by comma
x=[120.00000000, 240.00000000, 480.00000000, 960.00000000, 1920.00000000]
i want to paste numbers as in the txt file and separated by space as matrix not with comma

Answers (1)

Ameer Hamza
Ameer Hamza on 22 Sep 2020
Edited: Ameer Hamza on 22 Sep 2020
Use writematrix()
x=[120 240 480 960 1920];
writematrix(x, 'filename.txt', 'Delimiter', ' ');
In older versions
dlmwrite('filename.txt', x, ' ');

Categories

Find more on Data Import and Export 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!