How to get global variables recognized in main and in functions at the bottom
Mostra commenti meno recenti
I have a homework file that says "place global variables here" at the top and then "algorithm here" below that in a for loop and then I can put any helper functions at the bottom.
So I want my helper functions to see those static variables at the top.
But they don't. I have to copy and paste into the function bodies. This is so redundant and silly.
What is a work around? I am not sure I am allowed to put static variables in another file like I did with my functions I am reusing from a previous homework I made a class file and class encapsulating those functions as class methods.
1 Commento
Jan
il 18 Feb 2022
Please post a relevant part of the code, which reproduces the problem. "But they don't" is not precise enough to understand, what happens.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Function Creation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!