Not sending variable to workspace

조회 수: 1 (최근 30일)
Benjamin
Benjamin 2012년 6월 20일
Is there a way to not display a variable created in a script in the workspace?
for example: I have these variables, and what I'm doing with them is putting them into a struct.
a1 = middle_interpolate(327:362,:);
b1 = middle_interpolate(363:398,:);
a2 = middle_interpolate(689:724,:);
b2 = middle_interpolate(725:760,:);
a3 = middle_interpolate(1051:1086,:);
b3 = middle_interpolate(1087:1122,:);
a4 = middle_interpolate(1411:1448,:);
b4 = middle_interpolate(1449:1484,:);
s = struct('sA1',a1,'sB1',b1,'sA2',a2,'sB2',b2,'sA3',a3,'sB3',b3,'sA4',a4,...
'sB4',b4);
I know i could pass the values into the struct manually, but this would take a bit of time, is there a way to just not display the individual variables but still use them?
Thanks

채택된 답변

Tom
Tom 2012년 6월 20일
You would have to do this inside a function, but is there anything to stop you from creating the structure without generating those variables first? i.e.
s = struct('sA1',middle_interpolate(327:362,:),...
  댓글 수: 1
Benjamin
Benjamin 2012년 6월 20일
Yeah, that's what i was referring to when i mentioned that i could place the values into the struct manually, which I'll probably just end up doing. Thanks!

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 6월 20일
Do you mean in the Workspace Browser? If so, then you cannot create a (local) variable that does not show up in the Workspace Browser.

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by