I can't find helper function: transientBCHeatedBlock which is supposed to be in: matlab/R20​XXx/exampl​es/pde/mai​n

Trying to run example on Matlab site that includes:
model.EdgeBC(6)= ...
edgeBC(Temperature=@transientBCHeatedBlock);

2 comentarios

Can you confirm which release you're using and that you have Partial Differential Equations Toolbox installed? The ver function will include both these pieces of information.
Can you also show us the output of ls executed in that example's directory?
Hi Steven
Thanks for your response. I am using 2024a. I used ver and confirmed that I installed that toolbox. I don't understand your last question. Sorry
When try to run the code that I copied from the Matlab examples website I get the following in the Command Widow:
Undefined function 'solve' for input arguments of type 'struct'.
Error in untitled36 (line 28)
r= solve(model, tlist);
I think the problem is that I need to locate the help function that I was asking about and copy it into my code. I see the helper function as a subroutine that will be referenced when called on.

Iniciar sesión para comentar.

Respuestas (1)

The first thing you need to do is go through Preferences -> Help and install help locally.
Once that is done, look for
try
ls(fullfile(matlabshared.supportpkg.getSupportPackageRoot, 'examples', 'pde', 'main', 'transientBCHeatedBlock.m'))
catch ME
disp('not under support package root')
end
not under support package root
try
ls(fullfile(fileparts(docroot), 'examples', 'pde', 'main', 'transientBCHeatedBlock.m'))
catch ME
disp('not under docroot')
end
not under docroot
If it is not under either place then there is trouble.

8 comentarios

Hi Walter
I couldn't find it but thanks for your help.
john
See if
ls(fullfile(matlabshared.supportpkg.getSupportPackageRoot, 'examples', 'pde'))
exists at least.
This assumes that you went through Preferences -> Help to request that the help documents are loaded locally. And this also assumes that you have the PDE toolbox installed.
I pasted yoru suggestion into the Command Window and executed it. What came back was:
data examples.xml main
That seems promising but I don't know what to do next.
thanks for your help
Next see what shows up for
ls(fullfile(matlabshared.supportpkg.getSupportPackageRoot, 'examples', 'pde', 'main'))
Hi Walter,
The script file:
transientBCHeatedBlock.m
showed up in the files returned so that’s good.
I also noted this file that I would like to look at:
NoBoundaryConditionBetweenSubdomainsExample.mlx
Where can I find these?
Thanks
john
fullfile(matlabshared.supportpkg.getSupportPackageRoot, 'examples', 'pde', 'main', 'NoBoundaryConditionsBetweenSubdomainsExample.mlx')
Note that it is NoBoundaryConditionsBetweenSubdomainsExample.mlx
Hi Walter
Many thanks for your help. I apologize for being such a novice. I understood yoru answer ot mean that I could find the files of interest if I entered what you sent me into teh Command WIndow and ran it. When I did I got this repsonse:
ans = '/SupportPackages/examples/pde/main/NoBoundaryConditionsBetweenSubdomainsExample.mlx'
I don't know what to do.
john
Now
ls(fullfile(matlabshared.supportpkg.getSupportPackageRoot, 'examples', 'pde', 'main', 'NoBoundaryConditionsBetweenSubdomainsExample.mlx'))
Error using ls (line 47)
ls: cannot access '/SupportPackages/examples/pde/main/NoBoundaryConditionsBetweenSubdomainsExample.mlx': No such file or directory
to see if the file actually exists.
It is extremely unlikely that you happen to be using Linux and installed the files in /SupportPackages .
It is more likely that you are experimenting with using MATLAB Online. It is questionable whether MATLAB Online has the examples installed.
... I just checked using the Linux find utility. I confirm that MATLAB Online does not have the pde examples installed.

Iniciar sesión para comentar.

Productos

Versión

R2024a

Preguntada:

el 17 de Ag. de 2024

Editada:

el 3 de Sept. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by