Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Is it possible to set all data(n).x = []; without a for cycle?

조회 수: 1 (최근 30일)
Mr M.
Mr M. 2018년 10월 30일
마감: MATLAB Answer Bot 2021년 8월 20일
Is it possible to do the following withot a for cycle? for n = 1:N, data(n).x = []; end

답변 (1개)

madhan ravi
madhan ravi 2018년 10월 30일
편집: madhan ravi 2018년 10월 30일
data(1:N).x = []; %edited after Stephens comment
  댓글 수: 2
Stephen23
Stephen23 2018년 10월 30일
The square brackets are not required and just hinder JIT optimization.
madhan ravi
madhan ravi 2018년 10월 30일
Thanks Stephen read it before but forgot this time

태그

Community Treasure Hunt

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

Start Hunting!

Translated by