Is it possible to set all data(n).x = []; without a for cycle?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Is it possible to do the following withot a for cycle? for n = 1:N, data(n).x = []; end
Answers (1)
madhan ravi
on 30 Oct 2018
Edited: madhan ravi
on 30 Oct 2018
data(1:N).x = []; %edited after Stephens comment
2 Comments
Stephen23
on 30 Oct 2018
The square brackets are not required and just hinder JIT optimization.
madhan ravi
on 30 Oct 2018
Thanks Stephen read it before but forgot this time
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!