how to plot the graph for the following result

1 回表示 (過去 30 日間)
jaah navi
jaah navi 2019 年 2 月 5 日
コメント済み: jaah navi 2019 年 2 月 7 日
I am getting the following result in the command window.
iter = 1
1. global fitness is 1.9669
iter = 2
2. global fitness is 1.9669
iter = 3
3. global fitness is 1.9669
iter = 4
4. global fitness is 1.2878
I want to plot the graph in a manner iter should be on x axis and global fitness on y axis.
I tried with the command plot((global_fitness,:),'-*b') but unable to get the result.
Could anyone please help to fix the issue

採用された回答

KSSV
KSSV 2019 年 2 月 5 日
figure
hold on
for i = 1:100
global_fitness = rand ;
plot(i,global_fitness,'*r')
end
Or, save all the values of a loop and plot at the end.
y = zeros([],1) ;
for i = 1:100
global_fitness = rand ;
y(i) = global_fitness ;
end
plot(1:100,y,'*r')
  13 件のコメント
KSSV
KSSV 2019 年 2 月 6 日
i have asked some question as well....did you see that?
jaah navi
jaah navi 2019 年 2 月 7 日
With resepect to the codingi need to find on which iteration the fitness function is getting converged.And to get the centroid location with respect to the data sets.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by