How to change string name being passed through function argument automatically?

4 vues (au cours des 30 derniers jours)
Hello!
I am currently creating line plots for several parameters (50+). All of the parameter data is stored in two tables (one with a column for each parameter and its numeric data and another with one colum listing each parameter and its associated limits). I would like to create a loop that allows me to pass all the parameters and their limits one by one so that I can output the plots. The problem I'm encountering is that I cannot figure out how to pull the string name from one table and pass those strings as a different function argument each time. I would like to avoid having to plot each parameter individually.
Examples of places where I would like to replace strings:
ind = find(strcmpi(Table1.Parameter, 'Parameter Name 1')
ylabel('Parameter Name 1')
title('Parameter Name 1')

Réponse acceptée

Walter Roberson
Walter Roberson le 28 Jan 2020
P = Table1.Properties.VariableNames;
for k = 1:length(P)
Name = P{k};
Value = Table1{:, k};
MyPlot(Name, Value);
end

Plus de réponses (0)

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by