MATLAB Troubleshooting PDEs in MATLAB: Why is My Function Not Affecting the Plot?

AI Thread Summary
When working with PDEs in MATLAB, issues can arise when the software does not recompile a function after changes are made. This often happens due to MATLAB caching compiled files, which can prevent updates from being reflected in the output. To resolve this, it is important to locate and remove the compiled files associated with the function, which share the same name as the .m file but have a different extension. This is particularly problematic when files are stored on network drives, where modification dates may not update correctly. Ensuring that these compiled files are deleted can force MATLAB to recompile the function, allowing changes to take effect in the results.
member 428835
Hi PF!

I am trying to solve a pde in MATLAB and started by using the generic code mathwork supplies and then augmenting for my purpose. After defining the function below and run the script, i can do anything to the ##f## and nothing changes. I can literally delete the line and still I receive the same plot. Any idea why?
Code:
function [c,f,s] = pdex1pde(x,t,u,DuDx)
c = 1;
f = DuDx;%pdedu/dx
s = u;
 
Physics news on Phys.org
Sometimes when MATLAB compiles a function, it saves the compilation and will not recompile unless it knows the function has changed. Sometimes this goes wrong. I have had to remove compiled files from the directory to force MATLAB to recompile a new version. I forget what extension the compiled file had. I remember that I had a lot of problems when the files were on a network drive. Sometimes modification dates on network drive files do not get updated correctly to indicate a change.
 
Do you know how to remove or where to look to remove compiled files from the directory to force MATLAB to recompile a new version?

Thanks for taking interest to this!
 
My memory is vague on this. Look in the same directory with your .m file that defines the function. It will have the same function name but will have a different extension.
 
  • Like
Likes member 428835
Thanks a ton!
 

Similar threads

Replies
8
Views
3K
Replies
6
Views
4K
Replies
2
Views
4K
Replies
1
Views
4K
Back
Top