Created
September 4, 2023 16:50
-
-
Save z1nc0r3/0aeeedecb6144954700b723931aba7f0 to your computer and use it in GitHub Desktop.
Split Data into Train and Test set using Matlab
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 [train, test] = splitData(data) | |
[m, n] = size(data); | |
train = []; | |
test = []; | |
nTrain = round(m * 0.7); | |
train = data(1:nTrain, :); | |
test = data(nTrain + 1:m, :); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment