PDETOOL Matlab - Plotting Linear Element?

Click For Summary
SUMMARY

This discussion focuses on using the PDE Toolbox in MATLAB to plot surface values for linear elements. The user, Jay, successfully created a surface plot of two electrodes by subtracting smaller rectangles from a larger one. The main challenge is accessing the data from the surface plot to extract specific values, such as those at y=6, for further manipulation. A solution is provided involving the use of MATLAB commands to retrieve the children of the figure and access the necessary data structure.

PREREQUISITES
  • Familiarity with MATLAB and its PDE Toolbox
  • Understanding of surface plots and electrostatic systems
  • Knowledge of MATLAB figure properties and data structures
  • Basic programming skills in MATLAB scripting
NEXT STEPS
  • Explore MATLAB's PDE Toolbox documentation for advanced plotting techniques
  • Learn about MATLAB figure properties and how to manipulate them
  • Investigate methods for extracting data from surface plots in MATLAB
  • Study the use of MATLAB's get and set functions for figure components
USEFUL FOR

MATLAB users, engineers working with electrostatic simulations, and data analysts looking to visualize and manipulate surface plot data in the PDE Toolbox.

BlueJay99
Messages
2
Reaction score
0
Hi,

I've written a script that creates a few rectangles and gives the surface plot in the PDE toolbox.

What I would like to do is to also plot the values for a linear element in the surface plot i.e. for a given value of x or y.

Any help or ideas would be greatly appreciated!

Jay
 
Physics news on Phys.org
To add more detail to my problem...

Using the pdetool I created 3 rectangles (using the first method you described), 1 large rectangle (R1) and 2 smaller rectangles (R2 and R3) that are within R1 but not in contact. By applying the formula R1-(R2+R3) and solving it as an electrostatic system in the toolbox I essentially get the cross-sectional surface plot of 2 electrodes (given below).

pdeexample-1.png


What I would now like to do is for example just look at the values at say y=6 and plot a simple x-y graph which would look something like below:

g587-2.png


I guess my fundamental problem is not being able to access the information from the surface plot to then manipulate the data. Any insight anyone has into the problem would be greatly appreciated!

Jay
 
You have to "get" the "grandchildren" of the figure.

you can use:

child = get(gcf,'Children')
grandchild = get(child,'Children')

then:

X = get(grandchild)

will give you a structure, X, from which you can pull components:

X.Cdata

wil probably then be the data you're looking for, but I'm not sure. Have a look at the fields of X.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K