cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Loop Output Scalar - Should be Vector

atbarajas
1-Newbie

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

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:atbarajas)

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

View solution in original post

3 REPLIES 3
RichardJ
19-Tanzanite
(To:atbarajas)

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

View solution in original post

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

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

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."