TMacquart / OptiBLESS

Composite Optimisation Toolbox / Stacking Sequence Optimization
BSD 2-Clause "Simplified" License
19 stars 11 forks source link

Octave issue #1

Open benoitpaillard opened 5 years ago

benoitpaillard commented 5 years ago

Hi,

I'm trying to adapt your code to octave (if using an open source code, why not using an open source language right ?), and I'm having an error with Learn2use_Example1.m that I can't understand : FormatInput crashes on this line:

BCs.UB.Nply = cellfun(@length,AllowedNplies(NStruct.NpatchVar),'UniformOutput', true);

Because NStruct.NpatchVar is zero rather than a masking matrix, but this example gives 8 minimum and 8 maximum layers so... I'm not sure I fully grasp the process. Any help appreciated !

TMacquart commented 5 years ago

Hello Benoit,

Might be a different version of the code not appreciating working with empty cell. I believe you could simply bypass the if statement altogether by adding a second statement.

if ~isempty(sum(NStruct.NpatchVar)) && sum(NStruct.NpatchVar)>0 BCs.LB.Nply = ones(sum(NStruct.NpatchVar),1); BCs.UB.Nply = cellfun(@length,AllowedNplies(NStruct.NpatchVar),'UniformOutput', true); else BCs.LB.Nply = []; BCs.UB.Nply = []; end

Let me know if that solves your problem.

Cheers, Terence