필터 지우기
필터 지우기

Is there a quick method to remove data from a structure?

조회 수: 3 (최근 30일)
Duncan Wright
Duncan Wright 2017년 10월 9일
댓글: Duncan Wright 2017년 10월 10일
I'm trying to remove data from my structure (ie first 27000 points).
I am aware of a method I could use (demonstrated below), but I was wondering if there is a more efficient method?:
Data2.Time = Data2.Time(27000:end)
Data2.MissingData(27000:end)
Data2.TimeStampsMatlab(27000:end)
Data2.Range(27000:end)
Data2.Vel_Beam1(:,27000:end)
I have 100+ variables so ideally I don't have to do this..
Thanks!
  댓글 수: 2
James Tursa
James Tursa 2017년 10월 9일
Do you have 100 variables named Data1, Data2, Data3, etc?
Guillaume
Guillaume 2017년 10월 9일
편집: Guillaume 2017년 10월 9일
I believe he means he's got 100 fields, not variables.

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

채택된 답변

Guillaume
Guillaume 2017년 10월 9일
If I understood correctly, all that would be needed is:
Data2 = structfun(@(fld) fld(:, 27000:end), Data2, 'UniformOutput', false);

추가 답변 (0개)

카테고리

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