Autmating a matlab script
이전 댓글 표시
Hello all, I am trying to run a matlab script for a dataset. For this I have to change the script for each data file. For example below is my script and my datasets goes from data 1 till data 40. I want to automate this and get all the graphs at one time. Is this possible and how can I do this? Thank you in advance.
load data40 ; %%change the number after data into the desired data
frequency = data40(:,1); %%name the variable 1st collumn to frequency
zabsolute = data40(:,2); %%name the variable 2nd collumn to zabsolute
degree = data40 (:,3); %%name the variable 3rd collumn to degree
x= frequency * 1000; %% frequency is given in KHz multiply with 1000
y1 = zabsolute .* cosd(degree); %% formula to calculate the imaginair component of impedance
y2 = zabsolute .* sind(degree); %% formula to calculate the real component of impedance
subplot(2,1,1);
plot(x,y1),
title ( ' Resistance ' );
xlabel ( ' Frequency (Hz)');
ylabel ( ' Re Z');
subplot (2,1,2);
plot (x,y2);
title ( ' Reactance' );
xlabel ( ' Frequency (Hz)');
ylabel ( ' Img Z')
댓글 수: 2
KALYAN ACHARJYA
2021년 3월 3일
There are many similar questions, which have already been answered, please do a search with "Call Multiple Image + MATLAB" (Google)
Bayram Akpinar
2021년 3월 3일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!