フィルターのクリア

how to plot two graphs using a matlab?

1 回表示 (過去 30 日間)
Carc
Carc 2023 年 1 月 16 日
回答済み: Voss 2023 年 1 月 17 日
I am trying to plot lots of data in one figure, but I can't plot my last one(wattdis).
The plot for equation 'wattdis' can not be plotted in my figure. Could you point out what errors I have in my code?
data = readtable('dataform');
x1 = data.incidentenergy1;
x2 = data.incidentenergy2;
U238_MT102 = data.U238_MT102 * 516.79*10^-6;
U238_MT18 = data.U238_MT18 * 516.79*10^-6;
U238_MT2 = data.U238_MT2 * 516.79*10^-6;
C12_MT2 = data.C12_MT2 * 8.216*10^-2;
U235_MT18 = data.U235_MT18 * 3.799 * 10^-6;
U235_MT102 = data.U235_MT102 * 3.799 * 10^-6;
maxwell = (2 .* pi / (pi .* 0.026/10.^6).^3/2) .* (x1.^1/2) .* exp(-x1/(0.026/10.^6));
wattdis = 0.4865 .* (x1.^1/2) .* ((2.* x1).^1/2) .* exp(-x1); %% Watt distribution
loglog(x1,U238_MT102);
grid on
hold on
loglog(x1,U238_MT18)
loglog(x1,U238_MT2)
loglog(x2,C12_MT2)
loglog(x2,U235_MT18)
loglog(x2,U235_MT102)
title('cross section')
xlabel('Incident energy(MeV)')
ylabel('Macroscopic cross sectiob(b)')
legend('U238 MT=102','U238 MT=18','U238 MT=2','C12 MT=2','U235 MT=18','U235 MT=102')
yyaxis right;
semilogx(x1, maxwell)
yyaxis left;
semilog(x1, wattdis) %% I cannot plot this one.
holf off

回答 (1 件)

Voss
Voss 2023 年 1 月 17 日
semilog should be semilogx, and holf should be hold
% semilog(x1, wattdis) %% I cannot plot this one.
semilogx(x1, wattdis)
% holf off
hold off

カテゴリ

Help Center および File ExchangeUMTS Test and Measurement についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by