필터 지우기
필터 지우기

error: assignment dimension mismatch

조회 수: 1 (최근 30일)
mohamad mohamad
mohamad mohamad 2014년 3월 15일
편집: mohamad mohamad 2014년 3월 15일
I=imread('data (15).tif'); % Read an image
IG = rgb2gray(I);
[M,N] = size(IG);
G(:,:,2) = I(:,:,2);
G(:,:,1) = 0;
G(:,:,3) = 0;
Y = rgb2gray(G);
i have a image data base and when i run this code on my images,it work well on all of them except 2 of them which are horizontal images and biger then others,can any one help me plz? this is the error :
Subscripted assignment dimension mismatch.
Error in main (line 13) G(:,:,2) = I(:,:,2);

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 3월 15일
Try
clear G
G(:,:,2) = I(:,:,2);
G(:,:,1) = 0;
G(:,:,3) = 0;
  댓글 수: 1
mohamad mohamad
mohamad mohamad 2014년 3월 15일
편집: mohamad mohamad 2014년 3월 15일
thank u so much for your instant answer
i wish the best for you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by