<div dir="ltr"><div><div><div><div><div>Hi all,<br><br></div>I have written an implementation of the cellfun function in Matlab for Scilab.<br><a href="https://in.mathworks.com/help/matlab/ref/cellfun.html">https://in.mathworks.com/help/matlab/ref/cellfun.html</a><br></div>My current implementation takes n cells and returns a cell which is n*i dimensional (where i is the size of each cell) and contains lists Ai of size m which is the size returned by function f in cellfun(f, c1, c2, ...., cn).<br><br></div>i.e. ans{i} = f(c1{i}), f(c2{i}), ... f(cn{i})<br><br></div>Here is my commit for this - <br><a href="https://codereview.scilab.org/#/c/19114/">https://codereview.scilab.org/#/c/19114/</a><br><br></div>But as suggested in the comments it should be - <br><span class="gmail-com-google-gwtexpui-safehtml-client-SafeHtmlCss-wikiPreFormat">cellfun(f, c1, c2, ..., cn) -></span><br><span class="gmail-com-google-gwtexpui-safehtml-client-SafeHtmlCss-wikiPreFormat">for i = 1:size(c1, "*")</span><br><span class="gmail-com-google-gwtexpui-safehtml-client-SafeHtmlCss-wikiPreFormat">        ret(i) = f(c1{i}, c2{i}, ..., cn{i});</span><br><span class="gmail-com-google-gwtexpui-safehtml-client-SafeHtmlCss-wikiPreFormat">end</span><br><div><div><div><div><br></div><div>If I could get some help with this and where am I going wrong, I would be highly grateful because the current commit gives exactly the same answers as the examples given by Matlab here - <a href="https://in.mathworks.com/help/matlab/ref/cellfun.html">https://in.mathworks.com/help/matlab/ref/cellfun.html</a><br><br></div><div>Thanking you.<br><br></div><div>Regards,<br></div><div>Siddhartha Gairola<br></div><div>(IRC : rocko)<br></div></div></div></div></div>