For loop formula and graphing problems

5 ビュー (過去 30 日間)
Todd
Todd 2013 年 11 月 9 日
コメント済み: Todd 2013 年 11 月 9 日
So I'm trying to plot the code below, and when I run the m file it simply gives me a blank graph with a y axis that only goes from 99-100. In addition running the for-loop by itself gives me 100 replicates of the results.
What do I need to do to fix this?
A=[0 0 .42
.6 0 0
0 .75 .95];
B=[42
0
95];
for i = [1:100]
Nt(:,i) = (A^i)*B
end
plot(Nt(:,i),i)
title('American Buffalo Population')
ylabel('Time (years)')
xlabel('Population')
subplot(3,1,1);plot (Nt(1,:))
subplot(3,1,2);plot (Nt(2,:))
subplot(3,1,3);plot (Nt(3,:))
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 9 日
What is your problem?

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

採用された回答

Walter Roberson
Walter Roberson 2013 年 11 月 9 日
  1 件のコメント
Todd
Todd 2013 年 11 月 9 日
That worked, thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSwitches and Breakers についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by