How can I plot multiple iteration loglog graphs.
조회 수: 5 (최근 30일)
이전 댓글 표시
N0 = 1*10.^9;
n = 3;
T=365*24*3600;
Table = cell(n, 4);
t = logspace(1, 7);
A = logspace(-22,-1);
ylabel('Activity /s^.-1');
xlabel('t');
set(gca,'xscale','log')
L(1) = 4.979*10.^-18;
L(2) = 3.329*10.^-7;
L(3) = 2.874*10.^-5;
for i=2:n
Bsum=0;
for t = 1:1*10.^5:T
Prod1 = 1;
for l = 1:i-1
Prod1 = Prod1*L(l);
end
for j = 1:i
Prod2 = 1;
for k = 1:i t
if k ~= j
Prod2 = Prod2*(L(k) - L(j));
end
end
Sum = Ssum+exp(-L(j)*t)/Prod2;
end
F = Sum*Prod1*N0;
A = Sum*L(i);
Table(i, :) = {i t F A };
fprintf('%d %d %d %d\n', Table{i, :, :});
end
end
My Scipt needs to output graphs for each iteration of i in terms of A against t, at the moment it will do it to i=3 but if I need to more I would like it to automatically plot the graphs like the subplot command.
Currently my code for my graph only outptus the whole of the iteration from 1:3 rather than each iteration
Activity = logspace(-22,-1);
loglog(A,t,'-o')
line(A, t)
Any help will be great!
댓글 수: 0
채택된 답변
Sindhu Karri
2020년 3월 27일
You can try using nexttile which is similar to subplot
By using nexttile, loglog inside the for loopyou will be able to plot the graph of (A,t) for each iteration.
Refer to the below link:
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!