Effacer les filtres
Effacer les filtres

Help with workspace data extraction shortcut

2 vues (au cours des 30 derniers jours)
Brantosaurus
Brantosaurus le 11 Nov 2022
Commenté : Brantosaurus le 13 Nov 2022
I am trying to extract data from the workspace from various possible locations.
X.output.name.param1(:,end)
X.output.name.param2(:,end)
:
X.output.name.paramN(:,end)
If possible, I would like to try access it via a named parameter, like below.
line 1: param = 'param2';
line 2: y = X.output.name.(param);
Doing this partly appears to work. I can see my data as a 25x3 matrix.
But how do i home in on the 3rd 'end' column by editing line 2, and not line 1?
Regards, Dave

Réponse acceptée

Walter Roberson
Walter Roberson le 11 Nov 2022
y = X.output.name.(param)(:,end)
  3 commentaires
Walter Roberson
Walter Roberson le 13 Nov 2022
Works for me
X.output.name.param2 = 1:5;
param = 'param2';
var = 'name';
y = X.output.(var).(param)(:,end)
y = 5
Brantosaurus
Brantosaurus le 13 Nov 2022
It works now!
Many thanks for that Walter.
I need to get out more!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by