creating a matrix that contains a struct
1 次查看(过去 30 天)
显示 更早的评论
Hi, I want to create a matrix that contains a struct in the first row. and integers in the next rows for example my matrix can look like this A=[[0,0,0],[0,0,1];1,1;0,1]
is there a way t do this? thanks
0 个评论
采纳的回答
Azzi Abdelmalek
2012-11-6
A={[0,0,0],[0,0,1];1,1;0,1}
1 个评论
Azzi Abdelmalek
2012-11-6
编辑:Azzi Abdelmalek
2012-11-6
n=10;
m=4;
A=cell(3,n)
for k=1:n
A{1,k}=rand(1,m) % eg
A{2,k}=randi(10,1,1) %eg
A{3,k}=randi(10,1,1) % eg
end
%doc cell
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!