Printing some values in a vector

3 Ansichten (letzte 30 Tage)
H
H am 13 Sep. 2019
Kommentiert: Rena Berman am 12 Dez. 2019
This is the data:
X = [0.23, 0.88, 0.21, 0.92, 0.49, 0.62, 0.77, 0.52, 0.30, 0.19]
function split(X,K)
% we assume N is divisible by K
N = length(X);
for k=1:K
tstart = 1+(k-1)*N/K;
tend = k*N/K;
test = tstart:tend
train = [1:tstart-1 tend+1:N]
pause;
end
train and test: these are indices. What if I want to print the values that are in train and test? How do I do that?
  2 Kommentare
Stephen23
Stephen23 am 27 Nov. 2019
Original question from Google Cache:
"Printing some values in a vector"
This is the data:
X = [0.23, 0.88, 0.21, 0.92, 0.49, 0.62, 0.77, 0.52, 0.30, 0.19]
function split(X,K)
% we assume N is divisible by K
N = length(X);
for k=1:K
tstart = 1+(k-1)*N/K;
tend = k*N/K;
test = tstart:tend
train = [1:tstart-1 tend+1:N]
pause;
end
train and test: these are indices. What if I want to print the values that are in train and test? How do I do that?
Rena Berman
Rena Berman am 12 Dez. 2019
(Answers Dev) Restored edit

Melden Sie sich an, um zu kommentieren.

Antworten (1)

madhan ravi
madhan ravi am 13 Sep. 2019
Bearbeitet: madhan ravi am 13 Sep. 2019

Kategorien

Mehr zu Testing Frameworks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by