Sum Object Properties: Signal
Mostra commenti meno recenti
I create my object using this class:
classdef myClass
properties
signal = [1 1 2 2 3 3];
end
end
The I instantiate N object of this class:
N = 1000;
for i = 1:N
obj(N) = myClass;
end
I would like to sum the 'signal property' of all N object and return a vector with same size of 'signal property' (6 col x 1 row).
Like this:
result_vector = Sum(obj.signal);
The result should be like:
[X X Y Y Z Z]
Is there any optimized way to do this sum operation without using a FOR loop? How can I do that?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Signal Operations in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!