In Matlab Coder: How can I work with cat function in a loop

조회 수: 3 (최근 30일)
Avi
Avi 2013년 10월 20일
Hello,
I have a problem in Matlab Coder.
  • * Here is the test file * * :A_in = magic(3);A_out = My_Func (A_in);
  • * And here is the funcion :* *function A_out = My_Func (A_in) [r, c] = size (A_in); a = double(repmat (A_in(1,:), 1, 1)); b = double(repmat (A_in(r,:), 1, 1)); Atemp = [a; double(A_in); b]; d = repmat(Atemp(:,1), 1, 1); e = repmat(Atemp(:,end), 1, 1); Atemp1 = [d Atemp e]; Atemp_all= []; for I = 1:3 for J = 1:3 f = Atemp1(I:I+r-1,J:J+c-1); Atemp_all= double (cat (3, Atemp_all, f)); end; end; A_out = median (Atemp_all,3);end
Running it in Matlab is OK. But trying to build My_Func_mex causes the next error:
Dimension 1 is fixed on the left-hand side but varies on the right ([0 x 0] ~= [:? x :? x :?])
Can you help me please? Thanks

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by