Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Showing results for

May 12, 2011
02:37 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

May 12, 2011
02:37 PM

Loop Output Scalar - Should be Vector

Hey everyone,

I've developed a loop where each value in the loop is a vector (e.g., x1 = 30 X 1 vector) so the loop should be returning vectors as well. Unfortunately, I'm getting scalars therefore ruining the later functions of the loop. I've narrowed it down to the portion that is returning scalars, and I was wondering if someone could help me figure out why it's doing this. I've attached the file that has been causing me grief for the past week.

Any help is greatly appreciated.

Talina

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

May 12, 2011
03:02 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

May 12, 2011
03:02 PM

On the rhs of the on error you also need the local assignment to Phat[i

3 REPLIES 3

May 12, 2011
03:02 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

May 12, 2011
03:02 PM

On the rhs of the on error you also need the local assignment to Phat[i

May 12, 2011
05:59 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

May 12, 2011
05:59 PM

Ah, thank you so much! You saved me several additional hours of grief.

May 12, 2011
03:16 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

May 12, 2011
03:16 PM

Talina Barajas wrote:

Hey everyone,

I've developed a loop where each value in the loop is a vector (e.g., x1 = 30 X 1 vector) so the loop should be returning vectors as well. Unfortunately, I'm getting scalars therefore ruining the later functions of the loop. I've narrowed it down to the portion that is returning scalars, and I was wondering if someone could help me figure out why it's doing this. I've attached the file that has been causing me grief for the past week.

Any help is greatly appreciated.

Talina

Your loop variable runs from 0 .. 3, but you've only got 3 elements in each of udot and udotdot so the loop crashes at i=3. Change the range from 0..2.

Stuart