Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi everyone, I'm programming a simple "for" statement and for some reason It doesn't work, I don't know what is the problem because I've defined all the variables but mathcad says that one of them is undefined.
I've attached the original file.
Thx in advance. And excuse me for my poor english, I'm Spanish.
Solved! Go to Solution.
I've changed a few items to make the program operate, but there are assumptions that may not be valid.
1. Moved the break statement to the end of the for loop, you can keep it at the beginning but then you will need to initialise the N.c, N.as & N.ai variables & the result will be the same.
2. the return value is now just x.f. Mathcad 15,14 ... does not like to mix units in arrays & the program was failing for this.
You can deUnit the return values & then add them back outside the program .
You may be able to return values with units directly but I don't know how (or even if it is possible)
3. the for loop needs to be defined as start value, next value ... final value
4.value of c changed from 0.01 to 0.01 *1/m to give a unit balance - not sure if this is correct or not.
Regards
Andy
Hello Maikel,
it appears as if your variable xf isn't defined and as a consequence all related variables fail. Correct this and it should work just fine.
Raiko
I've changed a few items to make the program operate, but there are assumptions that may not be valid.
1. Moved the break statement to the end of the for loop, you can keep it at the beginning but then you will need to initialise the N.c, N.as & N.ai variables & the result will be the same.
2. the return value is now just x.f. Mathcad 15,14 ... does not like to mix units in arrays & the program was failing for this.
You can deUnit the return values & then add them back outside the program .
You may be able to return values with units directly but I don't know how (or even if it is possible)
3. the for loop needs to be defined as start value, next value ... final value
4.value of c changed from 0.01 to 0.01 *1/m to give a unit balance - not sure if this is correct or not.
Regards
Andy
Thx a lot to everyone, specially to A Westerman, you were right.
I really really really appreciate your help.
This forum is awesome.
Saludos.
2. the return value is now just x.f. Mathcad 15,14 ... does not like to mix units in arrays & the program was failing for this.
You can deUnit the return values & then add them back outside the program .
You may be able to return values with units directly but I don't know how (or even if it is possible)
Hi again, may you tell me how can I deUnit the return values?
Regards.
All you can do is divide by the appropriate unit inside the program & the multiply by the same unit outside - not ideal , but best available.
Regards
Andy
Fantastic.
Thx again.
Regards
Unfortunately for me - 1 step forward , 3 steps back
A Westerman wrote:
Unfortunately for me - 1 step forward , 3 steps back
Point please your 3 steps back
No scripted components
No 3D plots
No Hyperlinking
(For starters)
Regards
Andy
A Westerman wrote:
No scripted components
No 3D plots
No Hyperlinking
(For starters)
Regards
Andy
No scripted components - no viruses
No 3D plots in Mathcad 15 on Windows 8
No Hyperlinks more security
Etc