How to turn on autocomplete for structure arrays

2 visualizaciones (últimos 30 días)
Jonathan
Jonathan el 1 de Abr. de 2014
I have an issue that wastes a LOT of my coding time and was wondering if there was a known resolution to it.
Matlab offers autocompletes generally (eg. if I have defined "constant_1"; I can type "cons", hit Tab and fill out the desired constant), however these don't work in structure arrays (eg. S.constant_1 cannot be filled via autocomplete by typing "S.cons" then Tab). This wastes time and introduces unnecessary errors into code.
Is there any way to get autocompletes to function in structure arrays?
In short, want functions like:
function S=simplecalc()
params=parameterfunction();
X=linspace(1,10,6);
S=params.constant_1*X.^params.constant_2 ;
To work with autocomplete to save the tedium and timewasting of typing out all of params.XYZ references by hand.
Many thanks for any help,
Jonathan
PS. For context, I use Matlab for geological problems have a lot of constants that I use across various codes (densities, permeabilities, thermodynamic properties...). Therefore instead of copy-pasting paragraphs & paragraphs of parameter declarations into all my codes, I call a function that returns a structure array "params.constant_#num". But referencing these constants is infuriating because they fail to interact with the matlab interface

Respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by