How can i change the values of parameter E1 to 1 then 50 and lastly 100 and plot a single graph that include three lines for three inputs of E1 in same graph. I need to draw a comparison

1 回表示 (過去 30 日間)
if true
E1 = 50;
E2 = 3;E4=8;E3=5;E5=7;E6=7;
tspan = [0 0.05];
y0 = [1 0 0 0];
[t,y] = ode45(@(t,y) odefcn(t,y,E1,E2,E3,E4,E5,E6), tspan, y0)
plot(t,y(:,1))
end

回答 (1 件)

Iddo Weiner
Iddo Weiner 2017 年 1 月 29 日
not sure exactly what you need, try this for general inspiration:
E1 = [1,10,100];
xdata = 1:3;
for i = 1:3
scatter(xdata(i),E1(i),100,'rp')
hold on
end
ylim([-10 110])
xlim([-1 4])
hold off
  2 件のコメント
Abhijot Mann
Abhijot Mann 2017 年 1 月 29 日
when i set E1 as 1, 50, 100 three lines with different colors should appear in same graph as shown in figure
Iddo Weiner
Iddo Weiner 2017 年 2 月 1 日
sorry but the code you posted returns an erorr, so I couldn't edit it directly. Could you post a full functioning code? If you do, I'll try editing it so it works the way you like it to.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by