Today, i’m happy of a solution i’ve found.

I turn the arrayfcn into a cellfcn:

```
f_h_Cell=@(x, y) {x .* y, 0}
nf = @(x) @mifCell2Mat (f_h_Cell (x (size (x) (1) * 0 / 2 + 1:size (x) (1) * 1 / 2,{':'} (ones (1, ndims (x) - 1)){:}), x (size (x) (1) * 1 / 2 + 1:size (x) (1) * 2 / 2, {':'} (ones (1, ndims (x) - 1)) {:})))
```

and then:

```
function res=mifCell2Mat(resCell)
resCell=transpose(resCell);
[~,idx]=max(cellfun(@numel,resCell));
refSize=(size(resCell{idx}));
resCell=cellfun(@(x) x+zeros(refSize),resCell,'uniformoutput',false);
res=cell2mat(resCell);
endfunction
```

All automate calling following function

f=fcn(name,domain,parms,fcn);

so a simple f.nf([x;y;z]) call gives the result.

Of course it doesn’t work, if there are numel’s between 1 and say size=[10,10] of

eg size=[10,1], but so what … In most cases it work’s for me (until now: allways).

Oh, while i read my code just here, i’ve found a little bug:

```
refSize=(size(resCell{idx}));
```

must of course change to

```
refSize=(size(resCell{idx(1)}));
```

cause there a possible more than one max sizes in the idx, so i’ve picked the first. I do first a test of constant outDims, so that these workaround only occours, if there are constants. In the other cases (if all outDims contain domainvars) a simple anonymous function of a matrix-handle appears to the user:

```
f_h_Mat=@(x, y) [x .* y; x]
nf=@(x) f_h_Mat (x (size (x) (1) * 0 / 2 + 1:size (x) (1) * 1 / 2, {':'} (ones (1, ndims (x) - 1)) {:}), x (size
(x) (1) * 1 / 2 + 1:size (x) (1) * 2 / 2, {':'} (ones (1, ndims (x) - 1)) {:}))
```

A warning appears because the function_handle - function gets a ‘cell’ class instead of a ‘sym’:

```
warning: expected output expressions to be syms
warning: called from
codegen>codegen_input_parser at line 184 column 7
codegen at line 21 column 40
function_handle at line 94 column 14
```

You can supress this with:

```
warning('off', 'expected output expressions to be syms');
```

Edit: Should work, but does not.

`[msg,id]=lastwarn()`

also gives no id

With id, you can suppress warnings with

`warnings('off',id);`

All of the tests i made suggests that there is no really problem regarding this warning.