Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Optimizing big size structure

2 visualizaciones (últimos 30 días)
Scott Urquhart
Scott Urquhart el 17 de En. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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

Respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by