sir i am using a simple line of code..
v(1)=(x*w1(1,:)')+(1*bias1(1,1));
y(1)=1/(1+exp(-v(1))); "
where w1 is a 15x784 matrix, bias1 is a 1x15 matrix and x is a 1x784 matrix. the error shown while doing the simple vector multiplication is::::::::
[ ??? Error using ==> mtimes MTIMES is not fully supported for integer classes. At least one input must be scalar.
To compute elementwise TIMES, use TIMES (.*) instead.]

2 件のコメント

KSSV
KSSV 2017 年 4 月 17 日
Post the whole code...
VISHAL SINGH
VISHAL SINGH 2017 年 4 月 17 日
i have written only a part of the whole progam..i mean i began to write.... just to check errors i run it....then it showed this error.

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

 採用された回答

dpb
dpb 2017 年 4 月 17 日
編集済み: dpb 2017 年 4 月 17 日

0 投票

While I don't see it at first blush in the code, one (or both) of the two variables must be integer class--
>> i1=eye(3);
>> i2=int16(ones(3,1));
>> i1*i2
Error using *
MTIMES is not fully supported for integer classes. At least one input must be scalar.
To compute elementwise TIMES, use TIMES (.*) instead.
>> i1*double(i2)
ans =
1
1
1
>>
See which is/are integers of some type and cast to a real (single or double) to do the computation.
ADDENDUM
On further inspection, the array train0 must be the integer-valued one...
x=double(train0(m,:))/255; %%picking a row from the set
will fix your present problem; whether you will then need to recast back to integer class for a result I don't know...

1 件のコメント

VISHAL SINGH
VISHAL SINGH 2017 年 4 月 17 日
thanks a lot sir.... seems that for present my problem has been solved. thanks again.

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

2017 年 4 月 17 日

コメント済み:

2017 年 4 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by