Can I create an array of matricies?

1 次查看(过去 30 天)
Hi, I'd like to know if I could create some matricies from array elements, for example, if I have four arrays of dimension n by 1, can I then create n matricies by defining something like M(i)=[array1(i),array2(i);array3(i),array4(i)] and running a loop over i? Any help would be appreciated. Thanks. Edit: Thanks for answering sixwwwwww, I didn't know you could make a matrix of arrays, but I was kind of hoping to do it the other way round (an array of matricies). My goal is to put the matricies into an equation and then plot the resulting elements, so I was hoping to be able to do something like: define a set of n matricies using nth elements of my arrays, put these n matrices into my equation to obtain another set of n matrices, then plot the resulting matrix elements against some function of n. Is there any way I could do this?

采纳的回答

sixwwwwww
sixwwwwww 2013-10-23
Dear James. you dont need loop for this you can do it like this:
array1 = rand(10, 1);
array2 = rand(10, 1) * 2;
array3 = rand(10, 1) * 3;
array4 = rand(10, 1) * 4;
M = [array1 array2 array3 array4];
I hope it is what you need. Good luck!
  3 个评论
James
James 2013-10-28
Yes, this is more what I was looking for, now I've got a nice little script for effective permittivities extraction from COMSOL data, thanks for the help :)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by