How Execute statements if else condition
古いコメントを表示
Hello Dears I have a Problem i Want to make Plots with Matlab for many Excel Files. but when i change The Excel File ,I must everytime change The Title , The Labels and Legends Manual can you help me to Programming this think . ich have a Idee but Matlab can not Executed it . can someone help me Please i need that for my Thesis. Thank you
% filename='File1';
omega=xlsread(filename);%Matrix 10078*28
[z,s]=size(omega);
t=1:1:10080;% Time vector
%
if filename=='File1' %everytime i change a File Name but they have a same size
figure(f1)
V1=omega(:,16);
V2=omega(:,17);
V3=omega(:,18);
plot(t,V1,'displayName','L1-N RMS 1/2(1-cyc)Max(V)')
hold on
plot(t,V2,'displayName','L2-N RMS 1/2(1-cyc)Max(V)')
hold on
plot(t,V3,'displayName','L3-N RMS 1/2(1-cyc)Max(V)')
title('Compare the Current Harmonic ')
ylabel('I Max(A)' )
end
%
if filename='File2.xlsx'
V1=omega(:,16);
V2=omega(:,17);
V3=omega(:,18);
plot(t,V1,'displayName','L1-N RMS 1/2(1-cyc)Max(V)')
hold on
plot(t,V2,'displayName','L2-N RMS 1/2(1-cyc)Max(V)')
hold on
plot(t,V3,'displayName','L3-N RMS 1/2(1-cyc)Max(V)')
title('Compare the Voltage Harmonic L1 ')
ylabel('U Max(v)' )
end
4 件のコメント
Walter Roberson
2017 年 12 月 13 日
Is the information 'I Max(A)' or 'U Max(v)' somewhere in the Excel file? And the information 'Current Harmonic' or 'Voltage Harmonic L1' ?
houssem chedli
2017 年 12 月 13 日
Walter Roberson
2017 年 12 月 13 日
In your input file, are the columns labeled with names such as 'L1-N RMS 1/2(1-cyc)Max(V)' ?
Would it be practical to prepare a single file with a number of fields:
- input file name
- title for the plot
- ylabel to use for the plot
- legend entries for each column of data
? If it would be practical to do that, then we could read the information out of the file and apply it automatically to the plots.
houssem chedli
2017 年 12 月 13 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Half-Normal Distribution についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!