Machine learning program question

The program I'm asking my question about is in that link: http://read.pudn.com/downloads197/sourcecode/macos/928928/CancerDiagnosis.m__.htm
Now, what does this command do exactly:
testmat= matrix(idtest,:);
and why it's not giving this error:
Subscript indices must either be real positive integers or logicals.

1 件のコメント

CHANDRU G
CHANDRU G 2020 年 5 月 30 日
x=x+3; data.Xval=data.Xval +3; Multiply the values in the X variable of the table letter by the aspect ratio of 1.5.Reassign the result back to X so that letter contains the corrected data

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2016 年 8 月 3 日

0 投票

5 件のコメント

Mohamed Ahmed
Mohamed Ahmed 2016 年 8 月 3 日
編集済み: Mohamed Ahmed 2016 年 8 月 3 日
i know this way of indexing. What i mean in my question that
for this command
testmat= matrix(idtest,:)
"idtest" is a logical type with 569 row of zeros, wasn't it supposed to return an empty array ?
i tried the same steps but by the following:
idtest=logical(zeros(569,1))
testmat= matrix(idtest,:)
this gave me an o/p of empty matrix
but when using those commands
idtrain = training(c);
testmat= matrix(idtest,:)
the o/p of idtrain is 569 row and 1 column but the o/p of testmat is not an empty matrix
so, what's the difference?
Walter Roberson
Walter Roberson 2016 年 8 月 3 日
Please show
class(idtest)
nnz(idtest)
Mohamed Ahmed
Mohamed Ahmed 2016 年 8 月 4 日
編集済み: Mohamed Ahmed 2016 年 8 月 4 日
When trying :
idtest=test(c);
testmat= matrix(idtest,:);
The o/p is:
ans =
logical
ans =
1
When trying:
idtest=logical(zeros(569,1));
testmat= matrix(idtest,:);
the o/p is:
logical
ans =
0
Walter Roberson
Walter Roberson 2016 年 8 月 4 日
The original idtest is not all zero. You can use
[row, column] = find(idtest)
to see the row and column of the one (and only one) non-zero entry in it.
Mohamed Ahmed
Mohamed Ahmed 2016 年 8 月 4 日
Thanks very much.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2016 年 8 月 2 日

コメント済み:

2020 年 5 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by