Subscripted assignment dimension mismatch.!!!!!

1 回表示 (過去 30 日間)
vidya
vidya 2013 年 11 月 13 日
コメント済み: Matt J 2013 年 11 月 13 日
hello sir i have problem with this error.I had resolved it ..it was working fine..but its again can anybody help me to solve this
img_out(:,:,1)= gb ??? Subscripted assignment dimension mismatch.!!!!!
img_out is array which should hold gb ,gb is a image
description of image gb
[m,n,o]= size(gb)
m =71 n =71 o =1
>> whos gb
Name Size Bytes Class Attributes
gb 71x71 40328 double
>> ndims gb
ans =
2
description about img_out
img_out = zeros(size(img_in,1), size(img_in,2), N); where N = 12
whos img_out Name Size Bytes Class Attributes
img_out 3x3x2 144 double
>> ndims img_out
ans =
2
description about img_in
whos img_in
Name Size Bytes Class Attributes
img_in 584x565 329960 uint8
ndims img_in
ans =
2
  2 件のコメント
Matt J
Matt J 2013 年 11 月 13 日
BTW, you are running ndims in a manner that will always give you "2" as a results, even when it is not true. E.g.,
>> img_out=rand(3,3,3);
>> ndims img_out
ans =
2
vidya
vidya 2013 年 11 月 13 日
oh ..how do i solve it now sir

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

採用された回答

Matt J
Matt J 2013 年 11 月 13 日
gb is too big to fit inside img_out(:,:,1). The former is 71x71 while the latter is 3x3.
  2 件のコメント
vidya
vidya 2013 年 11 月 13 日
oh...how do i solve it now sir..
Matt J
Matt J 2013 年 11 月 13 日
Change the matrices to the correct size.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by