Unrecognized function using PDE toolbox

5 visualizzazioni (ultimi 30 giorni)
Ghufran Aldawood
Ghufran Aldawood il 6 Lug 2022
Commentato: Steven Lord il 7 Lug 2022
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 Commento
DGM
DGM il 6 Lug 2022
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.

Accedi per commentare.

Risposte (1)

Steven Lord
Steven Lord il 6 Lug 2022
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 Commenti
Ghufran Aldawood
Ghufran Aldawood il 7 Lug 2022
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 il 7 Lug 2022
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

Accedi per commentare.

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by