Info

此问题已关闭。 请重新打开它进行编辑或回答。

how can i store the solution (3D mtarix) and its value for a population of N

1 次查看(过去 30 天)
i have a population of N elements and each produce a certain solution configuration 3D matrix( for example solution X is X(:,:,1)=[1 2 3;4 5 6] and X(:,:,2)=[7 2 3;9 5 8]) this configuration results in an objective function or penalty function equals to 90) i need to store all the solution configurations for all the N population and the corresponding penalty function so that i'll report the best solution reached and its value&configuration. i need it to be fast. thank you

回答(1 个)

Matt J
Matt J 2019-6-16
编辑:Matt J 2019-6-16
So the question is how to store a set of 3D matrices? Why not use a 4D matrix
Configs(:,:,:,1)=X1
Configs(:,:,:,2)=X2
...
Configs(:,:,:,N)=XN
or a cell array
Configs{1}=X1
Configs{2}=X2
...
Configs{N}=XN
  5 个评论
Matt J
Matt J 2019-6-17
You're welcome, but please Accept-click the answer to indicate that it helped you.

Community Treasure Hunt

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

Start Hunting!

Translated by