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

Loop with Vectors

polarnaut
6-Contributor

Loop with Vectors

Hello,

I'm attempting to use a For Loop to complete iterative calculations for multiple cases.  The program that I wrote works fine for single values (scalars), but doesn't work so well with vectors.  Results are coming out as scalar when it should be a vector.  I could use some help.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

You miss the vector index when calling M(delta[i)

 

Furthermore you have to provide a return value in case M(delta[i) >M.n[i

 

Try your first solve block (the working one) with the last or last but one values of your vectors to see what i mean.

 

View solution in original post

6 REPLIES 6

As far as I can see you opened four threads here in the forum and after posting your question you never came back to comment the answers and close the threads.

This behavior is a bit irritating.

polarnaut
6-Contributor
(To:Werner_E)

I apologize.  I was not familiar with the etiquette on this board.  I will endeavor to do better.

use subscript i for delta value

 

polarnaut
6-Contributor
(To:JBlackhole)

I tried that.  It did not work.

 

2019-09-10 11_12_45-PTC Mathcad Prime 3.1 - C__Users_g5fmxbnm_Desktop_Telework_Telework Working File.jpg

You miss the vector index when calling M(delta[i)

 

Furthermore you have to provide a return value in case M(delta[i) >M.n[i

 

Try your first solve block (the working one) with the last or last but one values of your vectors to see what i mean.

 

polarnaut
6-Contributor
(To:Werner_E)

That worked!  Thanks!

 

2019-09-10 14_23_03-PTC Mathcad Prime 3.1 - C__Users_g5fmxbnm_Desktop_Telework_Telework Working File.jpg

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