Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Optimizing big size structure

1 Ansicht (letzte 30 Tage)
Scott Urquhart
Scott Urquhart am 17 Jan. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 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

Antworten (0)

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by