I'm getting the error as matrix dimensions must agree at line no 20

1 回表示 (過去 30 日間)
Kiruba Raji.I
Kiruba Raji.I 2016 年 7 月 22 日
回答済み: Walter Roberson 2016 年 7 月 22 日
function [S1]= PCNN(S)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
Alpha_F=0.1;
Alpha_L=1.0;
Alpha_T=1.0;
V_F=0.5;
V_L=0.2;
V_T=20.0;
Beta=0.1;
Num=100;
W=[0.5 1 0.5;1 0 1; 0.5 1 0.5];
M=[0.5 1 0.5;1 0 1; 0.5 1 0.5];
F=zeros(size(S));
L=F;
Y=F;
U=F;
T=ones(size(S));
S=im2double(S);
for n=1:Num
F=exp(-Alpha_F)*F + V_F .* conv2(Y,W)+S;
L=exp(-Alpha_L)* L+V_L * conv2(Y,M);
U=F.*(1+Beta* L);
Y=double(U>T);
T=exp(-Alpha_T)*T+V_T*Y;
end
end

採用された回答

Walter Roberson
Walter Roberson 2016 年 7 月 22 日
That seems unlikely. Line 20 is the "for" loop.
You probably want to use the 'same' option for conv2()

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by