Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Optimizing big size structure

1 vue (au cours des 30 derniers jours)
Scott Urquhart
Scott Urquhart le 17 Jan 2018
Clôturé : MATLAB Answer Bot le 20 Août 2021
Hello, I am not very familiar with structure.
I have a program that request for input an obj structure with empty value in it. This is the code that returns the correct result but it is very slow. I was wondering if there were a different way to get to the same result but a lot faster?
tic
obj.FFT_h0=struct;
obj.FFT_h1=struct;
obj.FFT_h3=struct;
obj.FFT_h5=struct;
obj.FFT_h7=struct;
obj.FFT_h9=struct;
fft_buffer_size=2^14;
for i=1:fft_buffer_size
obj.FFT_h0(i,1).timestamp=[];
obj.FFT_h0(i,1).mag=[];
obj.FFT_h0(i,1).phase=[];
obj.FFT_h1(i,1).timestamp=[];
obj.FFT_h1(i,1).mag=[];
obj.FFT_h1(i,1).phase=[];
obj.FFT_h3(i,1).timestamp=[];
obj.FFT_h3(i,1).mag=[];
obj.FFT_h3(i,1).phase=[];
obj.FFT_h5(i,1).timestamp=[];
obj.FFT_h5(i,1).mag=[];
obj.FFT_h5(i,1).phase=[];
obj.FFT_h7(i,1).timestamp=[];
obj.FFT_h7(i,1).mag=[];
obj.FFT_h7(i,1).phase=[];
obj.FFT_h9(i,1).timestamp=[];
obj.FFT_h9(i,1).mag=[];
obj.FFT_h9(i,1).phase=[];
end
toc

Réponses (0)

Cette question est clôturée.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by