help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parcellfun gives error while getting the results


From: Olaf Till
Subject: Re: Parcellfun gives error while getting the results
Date: Fri, 25 May 2018 16:38:22 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Thu, May 24, 2018 at 10:01:59PM -0700, Prasad K wrote:
> Thanks Olaf 
> 
> The following is the example test program which triggers that error when
> uniform output is enabled.
> 
> my function:
> 
> /"function z =  testfun(x,y)
>      z = x + y;
> end
> 
> my main code:
> 
> pkg load parallel
> clc;clear all;close all
> Nproc = 8
> 
> input1 = repmat(1:500,20,1);
> input2 = 1:500;
> inputcell1= num2cell(input1,2);
> inputcell2 = num2cell(input2,2);
> 
> output = parcellfun(Nproc, @testfun,
> (inputcell1),(inputcell2),"uniformoutput",true)"/
> 
> 
> When uniformoutput is false the program shows no error and executes as
> expected.
> But when uniformoutput is true it gives following error
> 
> "
> Nproc =  8
> parcellfun: 20/20 jobs done
> error: reshape: can't reshape 1x10000 array to 20x1 array
> error: called from
>     parcellfun at line 452 column 21
>     main at line 20 column 8

In your previous post you reported a different error for this issue,
something with 'cat' and 'cell2mat' in line 448 of parcellfun.m.

If really the current error is your issue: This is not expected to
work with parcellfun (or with cellfun). Your function (testfun) has to
return only scalars to work with UniformOutput enabled. (The error
message of parcellfun could be improved for this.)

If your previously posted error message was the real issue, I'd need
an example triggering this.

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]