This question is closed. Reopen it to edit or answer.

How do I communicate the structure-file that includes my data (i.e., the function, the guess solution, the boundary conditions etc.) with the .m file that includes the code that solves the system of equations?

1 view (last 30 days)
tzina kokkala
tzina kokkala on 30 Nov 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello everyone. I have a code that solves a boundary value problem with a test PDE using bvp4c. My aim is to make this code more general (i.e., a code that does not contain the function, the conditions etc.) using a structure file such that by changing only the data in the structure-file and not the code, I can solve different systems.
More specifically, there are 4 .m-files in my code in which I define my data (such as: equations, boundary conditions, the guess for my solution and so on). I would like to make the code such that when I want to solve another system with different data, instead of changing them inside the file, I can change them outside with the help of structures. So far I learned how to make/save a structure.
I have zero experience with structures and I did not find a tutorial that gives me a similar-idea example to gain insight. (Can very well be that I did not look at the right places.) My problem is just that I do not know what commands to use so that I can pass the information (included in each structure) to a specific place in my .m file. I feel a little confused. To sum my questions up:
  • Is my aim possible at all?
  • Could you provide me (if possible) with an example of similar nature or with material(/link to a similar question -sorry if my question is a repeat-) where I can learn how to use structures and make them interact with other code?
Thank you very much in advance.

Answers (0)

Community Treasure Hunt

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

Start Hunting!