photo

Joe Exotic


Last seen: environ 2 ans il y a Actif depuis 2021

Followers: 0   Following: 0

Spoken Languages:
English, Russian, Spanish

Statistiques

  • Thankful Level 2
  • Thankful Level 1

Afficher les badges

Feeds

Afficher par

Question


I have a function "f" that returns a 1x2 vector, and I need to make a 3x2 matrix M by stacking the outputs f(x1), f(x2), f(x3) on top of each other, but Matlab won't parse it.
First, I wrote: M = [f(x1); f(x2); f(x3)] That didn't work - it gave me only the first outputs of every f (resulting in a 3x1 ...

plus de 2 ans il y a | 1 réponse | 0

1

réponse

Question


Why is a statement like "sortrows(A)(2:4)" "invalid array indexing" and how can I circumvent adding an extra line of code to make it work?
I could write: sorted = sortrows(A) sorted(2:4) However this seems clumsy and unnecessarily long to me. How can I compress it...

plus de 2 ans il y a | 1 réponse | 0

1

réponse