Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matrix assignment in a For Loop

Status
Not open for further replies.

Kultigin

Mechanical
Dec 22, 2003
3
Hi,
I'm using Mathcad 2001 and I wrote a very complicated program that consists of a For loop. When I want to compare a variable u[n] with its previous value u[n-1] in the loop, I naturally assign it to another variable at the end of the For loop, i.e. uold <- u but Mathcad somehow updates the previous value. Therefore;
u[n]-u[n-1]=0
When I tried the single variables, there's no problem, however if my variable is a vector/matrix, the problem occurs. Is there anyone who faced a similar problem as me??
Thx...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor