Help with workspace data extraction shortcut

조회 수: 4 (최근 30일)
Brantosaurus
Brantosaurus 2022년 11월 11일
댓글: Brantosaurus 2022년 11월 13일
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

채택된 답변

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

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series Events에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by