필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to do a graph

조회 수: 2 (최근 30일)
Riri
Riri 2014년 2월 2일
마감: MATLAB Answer Bot 2021년 8월 20일
Hey, This is what i've tried to do : Use a for loop to calculate the number of parasites in your body and in your assistant until day 30, and then show two graphs :
This is what i did but I only have one graph instead of two
% m is the number of parasites in my body and a is for the assistant. I started with 400 parasites and it increase at 10% per day.
for i=1:30
m(i) = 400*(1.1^i);
a(i) = 120*(1.2*i);
disp(plot(m));
disp(plot(a));
end
Thanks

답변 (1개)

Amit
Amit 2014년 2월 2일
m = zeros(30,1);
a = m;
for i=1:30
m(i) = 400*(1.1^i);
a(i) = 120*(1.2*i);
end
plot(m);
hold on;
plot(1:30,a,'b');

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by