フィルターのクリア

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side-what does it mean?

1 回表示 (過去 30 日間)
The code is given below-
feature(k,:)=[red1 white1 black1 greyblue1 lightbrown1 darkbrown1 dia1 diadiff Asy Entr contrast energy hmg cor Border]
where k = 1 : numberOfFiles
when border is added in this line, this error shows. otherwise it works. how can I add this without error?
  2 件のコメント
David Hill
David Hill 2021 年 1 月 30 日
Look at your variables and verify their sizes. I would gues that Border is not a row vector.
joynob ahmed
joynob ahmed 2021 年 1 月 30 日
but border is also a single value just like asy or entr or contrast.

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

回答 (1 件)

KSSV
KSSV 2021 年 1 月 30 日
Demo:
A = zeros(3,4) ; % initialization
% fill the values
for i = 1:3
A(i,:) = [rand rand rand rand] ; % only four values can be filled in each row of A
end
The above works because initialization and the filling the elements is correct.
B = zeros(2,3) ;
for i = 1:3
B(i,:) =[rand rand rand rand] ; % this will throw error
end
The above will throw error because B should have three elements in each row; but you are trying to save one extra. So, you need to initialize the array properly considering the dimensions you are going to fill in.

カテゴリ

Help Center および File ExchangePerformance and Memory についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by