How Copy certain values from one array to another in matlab?

8 ビュー (過去 30 日間)
sana
sana 2014 年 1 月 25 日
回答済み: Image Analyst 2014 年 1 月 25 日
I have two array the first one is fitnessData and the second one is MeanofBest. After 5 iteration 5 new values are added in the fitnessData array. Now the fitnessData array contains the old values plus the 5 new values. But i just want to copy those 5 new values into MeanofBest array. How can i do it? Any help will be appreciated thank you.

回答 (1 件)

Image Analyst
Image Analyst 2014 年 1 月 25 日
Not sure where you want them to go, but it you just want to tack the last 5 values of fitnessData onto the end of MeanofBest, do this:
MeanofBest(end+1:end+5) = fitnessData(end-4:end)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by