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

6 ビュー (過去 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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by