Close and clear sections

22 Ansichten (letzte 30 Tage)
Paula de Jong
Paula de Jong am 5 Mär. 2019
Kommentiert: Stephen23 am 5 Mär. 2019
I have a matlab code with multiple sections, circa 25 sections.
One question:
  1. The same variables are used in all the sections. Is there a possibility to make a section before all the assignment sections with all those variables? And that every section ''loops'' through this part. For example the easy ones like clear all, close all, clc but also values for the stepzise for the (different) differential equations in the sections.
Thanks!!
  1 Kommentar
Stephen23
Stephen23 am 5 Mär. 2019
"For example the easy ones like clear all, close all, clc"
should not be hard-coded in scripts or functions.
In any case, you can easily write a function which returns your hard-coded parameters, or define a simple structure which contains all of your parameters, and pass that.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by