create special matrix without use from for loop
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
xosro
am 24 Mai 2015
Beantwortet: Walter Roberson
am 24 Mai 2015
i wish create several matrix with out uses from for loop
for example
j=1;
for i=2:2:(2*T)
a=zeros(1,2*T);
a(i-1)=1; a(i)=-1;
one(j,:)=a;
j=j+1;
end
that every time T Replaced different number
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 24 Mai 2015
For any given T,
a = zeros(T,2*T);
a(1:2*T+1:end) = 1;
a(T+1:2*T+1:end) = -1;
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays 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!