HOW TO SAVE RESULTS OF EVERY LOOP WITH ITERATIONS

3 ビュー (過去 30 日間)
PRANAY DISHAN
PRANAY DISHAN 2018 年 1 月 21 日
コメント済み: Rakesh R 2019 年 3 月 11 日
Hello everyone, I am new to matlab and working on my Project.
I have the following code which saves the data of only one iteration. But i want to store the data of every iteration. the output results shows four 4 data but in work space there are only 2 stored. Can you please help me on this. Thank you.
clc; clear; close all;
MaxIt=2;
nPop=2;
[D, K, M] = problem3();
CostHandle = @(s) calc3(s);
empty_particle.Sol = [];
empty_particle.Cost = [];
for it=1:MaxIt
for i=1:nPop
%RANDOM SOLUTION
particle(i).Sol=solution3(D, K, M);
%COST CALCULATION
particle(i).Cost=CostHandle(particle(i).Sol);
end
end
  5 件のコメント
PRANAY DISHAN
PRANAY DISHAN 2018 年 1 月 22 日
thank u so much for prompt responses. i have achieved what was required. Thank u once again :-)
Rakesh R
Rakesh R 2019 年 3 月 11 日
can u publish it plz, even i am stuck in the same question.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by