how to convert this structure in simple array???

nPop=30;
firefly.Position=[];
firefly.Cost=[];
firefly.Load=[];
% Initialize Population Array
pop=repmat(firefly,nPop,1);

1 Comment

Can you elaborate? What you are expecting?

Answers (1)

Since I do not know what types of data are in your structure, I would create a table from it. Use the struct2table (link) function for that.

This question is closed.

Tags

Asked:

on 11 Jul 2017

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!