How to use i_temp function and load all data of simualtion?

조회 수: 1 (최근 30일)
i_temp=0;
for ftemp=[5:5:130,200:50:1000];
i_temp=i_temp+1;
load(['ZCodeDfig_',num2str(ftemp),'.mat']);
ZCodeDfig
f_fft(:,i_temp)=Vmagfinalfft;
v_fft(:,i_temp)=Vfinal;
if_fft(:,i_temp)=Imagfinalfft;
i_fft(:,i_temp)=Ifinal;
Z_fft(:,i_temp)=zftemp;
end
figure
y(ftemp)=dftemp;
r(ftemp)=zftemp;
stem(y,r);
hold off
  댓글 수: 4
Walter Roberson
Walter Roberson 2018년 9월 27일
Could you confirm that each .mat file contains at least two variables, one of which is a struct named Vabc575 and the other of which is a struct named Iabc575 and that the names of those variables do not change as the .mat file name changes?
Jaydeepkumar Patel
Jaydeepkumar Patel 2018년 9월 27일
yes it is contained with same and do not change as the .mat file changes

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2018년 9월 27일
Small improvement to the code, but nothing that would change the functioning.
i_temp=0;
for ftemp=[5:5:130,200:50:1000];
i_temp=i_temp+1;
datastruct = load( sprintf('ZCodeDfig_%d.mat', ftemp) );
Vabc575 = datastruct.Vabc575;
Iabc575 = datastruct.Iabc575;
ZCodeDfig
f_fft(:,i_temp)=Vmagfinalfft;
v_fft(:,i_temp)=Vfinal;
if_fft(:,i_temp)=Imagfinalfft;
i_fft(:,i_temp)=Ifinal;
Z_fft(:,i_temp)=zftemp;
end
  댓글 수: 18
Walter Roberson
Walter Roberson 2018년 9월 29일
You have
ftemp=[5:5:130,200:50:1000]
The first range, 5:5:130, stops before 575.
The second range, 200:50:1000, increments by 50s, and so includes 500, 550, and 600, but not 575.
The data you posted on Google Drive does not contain a file for 575.
Jaydeepkumar Patel
Jaydeepkumar Patel 2018년 9월 29일
I understand your point but 575 is just name of Workspace data, not any value (Vabc575) is a full name only but after your explanation of call to figure.it is work as per my need Thank you so much for your time and consideration.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by