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

Alan Weiss
Alan Weiss 2017년 4월 14일
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 2017년 4월 17일
편집: Noa Regev 2017년 4월 17일
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
Walter Roberson
Walter Roberson 2018년 9월 7일
It would help to have the complete error message, everything in red.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

질문:

2017년 4월 14일

댓글:

2018년 9월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by