error when calling descg in a function

hi, strangest thing.
I was working on a script using descg (PDE toolbox) and everything was great.
Then I turned this script into a function, and then my code crashes displaying the error: Too many output arguments.
using matlab 2017a.
any idea what i'm doing wrong? (I keep going back and forth and the only change is the function wrapper).
thanks!

5 Comments

Please give us some code that you wrote, at least the function header and the line where you call descg. Also give the complete, exact error message, everything in red, copy-pasted.
Alan Weiss
MATLAB mathematical toolbox documentation
function [mesh] = meshing()
sq2 = sqrt(2);
ver.A = [0, 0];
ver.B = [2, 0];
ver.C = [2 - sq2, sq2];
ver.D = [-sq2, sq2];
ver.E = [-sq2 + 0.9 / sq2, ver.D(2) - 0.9 / sq2];
ver.F = [ver.E(1) + 0.5, ver.D(2) - 0.9 / sq2];
ver.G = [-0.7 / sq2 + 0.5, 0.7 / sq2];
ver.H = [-0.7 / sq2, 0.7 / sq2];
% create polygon
names = fieldnames(ver);
for i = 1 : length(names)
x_ver(i) = ver.(names{i})(1);
y_ver(i) = ver.(names{i})(2);
end
% pdepoly(x_ver, y_ver, 'polyg')
load('pdepoly_output.mat') %i saved the export from pdepoly to workspace
dl = decsg(gd, sf, ns);
N = 100;
model = createpde(N);
pg = geometryFromEdges(model,dl);
mesh = generateMesh(model);
pdeplot(model)
end
Noa Regev
Noa Regev on 17 Apr 2017
Edited: Noa Regev on 17 Apr 2017
the error i get is : Too many output arguments.
attached is the pde_poly.mat which i upload to the workspace
I have exactly the same problem
It would help to have the complete error message, everything in red.

Sign in to comment.

Answers (0)

Asked:

on 14 Apr 2017

Commented:

on 7 Sep 2018

Community Treasure Hunt

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

Start Hunting!