Indexing of a temporary array.
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
x=(meshgrid([1 2 3],[1 2 3]).*meshgrid([1 2 3],[1 2 3])')
x=x(:)'
Is it possible to carry out the above 2 operations in a single line code. Or in other works is there a way to go around the restriction in Matlab 'A temporary array cannot be indexed'.? Thanks in Advance.
0 commentaires
Réponse acceptée
Walter Roberson
le 20 Oct 2012
x = reshape( (meshgrid([1 2 3],[1 2 3]).*meshgrid([1 2 3],[1 2 3])'), 1, []);
0 commentaires
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!