# Printing some values in a vector

2 ビュー (過去 30 日間)
H 2019 年 9 月 13 日
Commented: Rena Berman 2019 年 12 月 12 日
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 件のコメント

Stephen Cobeldick 2019 年 11 月 27 日
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 2019 年 12 月 12 日
(Answers Dev) Restored edit

サインイン to comment.

### 件の回答 (1)

madhan ravi 2019 年 9 月 13 日

help fprintf

#### 0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。

Translated by