Unrecognized function using PDE toolbox

조회 수: 6 (최근 30일)
Ghufran Aldawood
Ghufran Aldawood 2022년 7월 6일
댓글: Steven Lord 2022년 7월 7일
Hello,
I am trying to run the exact code from this example:
But I get an error for unrecognized function 'addCell'. I have the PDE toolbox installed (checked using ver command).
I am able to plot and use functions like 'createpde' as in this example:
So I'm not sure why the 'addCell' function is not working. I appreciate any help on this.
  댓글 수: 1
DGM
DGM 2022년 7월 6일
I don't have PDE toolbox or a new enough version, but this should be the relevant tool
introduced in R2021a
As to why it's not showing up, I don't know.

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

답변 (1개)

Steven Lord
Steven Lord 2022년 7월 6일
According to the addCell documentation page, the input arguments you pass into addCell must be a "3-D geometry, specified as a DiscreteGeometry object."
Are you calling addCell with two DiscreteGeometry objects or are you trying to call it with something else like a numeric array? If the latter, that won't work.
  댓글 수: 2
Ghufran Aldawood
Ghufran Aldawood 2022년 7월 7일
Hello, thank you for your response. Here is the code used:
coreGm = multicylinder(0.03,0.1);
coilGm = multicylinder([0.05 0.07],0.2,"Void",[1 0]);
airGm = multicylinder(1,2);
coreGm = translate(coreGm,[0 0 1.025]);
coilGm = translate(coilGm,[0 0 0.9]);
gm = addCell(airGm,coreGm);
gm = addCell(gm,coilGm);
It uses discrete geometry of a cylinder.
Steven Lord
Steven Lord 2022년 7월 7일
coreGm = multicylinder(0.03,0.1);
coilGm = multicylinder([0.05 0.07],0.2,"Void",[1 0]);
airGm = multicylinder(1,2);
coreGm = translate(coreGm,[0 0 1.025]);
coilGm = translate(coilGm,[0 0 0.9]);
gm = addCell(airGm,coreGm);
gm = addCell(gm,coilGm)
gm =
DiscreteGeometry with properties: NumCells: 3 NumFaces: 10 NumEdges: 8 NumVertices: 8 Vertices: [8×3 double]
Can you set a breakpoint on the line with the first addCell call and execute the following command when MATLAB stops at the breakpoint, or can you add the command immediately before that call?
whos
Name Size Bytes Class Attributes airGm 1x1 8 pde.DiscreteGeometry cmdout 1x33 66 char coilGm 1x1 8 pde.DiscreteGeometry coreGm 1x1 8 pde.DiscreteGeometry gm 1x1 8 pde.DiscreteGeometry
I want to see what classes airGm, coreGm, and coilGm are. I'm curious if you have a multicylinder or translate function that's somehow taking precedence over the ones in Partial Differential Equations Toolbox and those functions are causing one of those variables not to be what you expect. While you're at it, seeing the output of these commands might be useful too.
which -all multicylinder
built-in (/MATLAB/toolbox/pde/multicylinder)
which -all translate
/MATLAB/toolbox/stateflow/stateflow/private/translate.m % Private to stateflow /MATLAB/toolbox/matlab/polyfun/@polyshape/translate.m % Shadowed polyshape method translate is a built-in method % Shadowed matlab.graphics.primitive.Transform method translate is a Java method % Shadowed com.mathworks.mde.liveeditor.debug.LiveEditorDebugEventTranslator method translate is a Java method % Shadowed com.mathworks.mlservices.MatlabDebugServices$DebugEventTranslator method translate is a built-in method % Shadowed pde.DiscreteGeometry method
which -all addCell
addCell is a built-in method % pde.DiscreteGeometry method

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

카테고리

Help CenterFile Exchange에서 Eigenvalue Problems에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by