creating a matrix that contains a struct
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 6 Nov. 2012
A={[0,0,0],[0,0,1];1,1;0,1}
1 Kommentar
Azzi Abdelmalek
am 6 Nov. 2012
Bearbeitet: Azzi Abdelmalek
am 6 Nov. 2012
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
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!