Skip to content

Instantly share code, notes, and snippets.

@z1nc0r3
Created September 4, 2023 16:50
Show Gist options
  • Save z1nc0r3/0aeeedecb6144954700b723931aba7f0 to your computer and use it in GitHub Desktop.
Save z1nc0r3/0aeeedecb6144954700b723931aba7f0 to your computer and use it in GitHub Desktop.
Split Data into Train and Test set using Matlab
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