How fill a part of 3D array with decreasing values?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear all,
I have a 3D array and I just want to fill a buck of this array with decreasing values, with step i've chosen. The values would decrease only in one direction, and constant on the two others.
For instance i have this : >> N=10; >> X=zeros(N,N,N); >> X(:,:,1:10)=20:-2:2; ??? Assignment has fewer non-singleton rhs dimensions than non-singleton subscripts
Could somebody help me with the syntax please?
Thanks in advance.
Alexandre.
0 commentaires
Réponse acceptée
Carlos
le 8 Mar 2013
I think you are trying to do something like this
>> a=20:-2:2;
>> for i=1:10
for j=1:10
X(i,j,1:10)=a(1:10);
end
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!