Hello. I am having trouble plotting a 2D "time snapshot" of a solution to a parabolic heat equation. The mesh plot seen near the bottom of my code works like a charm. However, I am supposed to try and plot a 2D "time snapshot" at time t = 20, so essentially just taking a slice of my 3D mesh. I am unsure how to do this. I have tried numerous things and nothing seems to be working. One of my classmates was able to use plot(:,401); to get his to work, where 401 is the final n iterate. This does not seem to work for me though. I get an error about an undefined function or variable with plot. From what I can tell, it does not like the semi-colon. I am not sure why this is a problem for me and not him, as our code is essentially the same. If anyone is able to show me how to make this 2D plot I would greatly appreciate it. A photo of my code is below:
MATLAB: Plotting a 2D “Time Snapshot”
MATLABplotting
Related Question
- Unexpected Result for 3-D Thermal Transient Analysis of Heat sink using PDE Solver Toolbox
- How to vectorized the following for loop code
- PDE TOOLBOX: PLOT HEAT FLUX AT 3D NODAL POSITIONS
- Hi, I’m trying to solve the heat eq using the explicit and implicit methods and I’m having trouble setting up the initial and boundary conditions.The equation is : du/dt=d^2u/dx^2, initial condition u(x,0)=x, boundary conditions u(0,t)=1 du/dx(1,t)
- Subscript indices must either be real positive integers or logicals help line u1(0)=2
Best Answer