Close and clear sections

조회 수: 22 (최근 30일)
Paula de Jong
Paula de Jong 2019년 3월 5일
댓글: Stephen23 2019년 3월 5일
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
Stephen23
Stephen23 2019년 3월 5일
"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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by