For loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
For loop
I have defined function with "for loop" inside for table content processing. It looks simple, but unfortunately it doesn't work. Instead of calculation results , the message "This value mus be a scalar a matrix" is being displayed.
I was using this function with Mathacad 15 and it was working fine, but I can't reproduce it within Mathcad Prime 8.
Where did I go wrong?
Regards,
Bogdan
Solved! Go to Solution.
- Labels:
-
Programming
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
ttokoro already pointed you to the error.
You had an implicit multiplication between "(rows)" and "N.t.".
It should read "rows(N.t.)" instead!
Now you should get the expected result:
You can achieve the very same result without any utility function in one go using a boolean comparison and vectorisation
Another option is using a simpler utility function, written to be used with just one scalar and called vectorized.
Here are two example for that kind of utility function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
rows(Nt)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Maybe try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
ttokoro already pointed you to the error.
You had an implicit multiplication between "(rows)" and "N.t.".
It should read "rows(N.t.)" instead!
Now you should get the expected result:
You can achieve the very same result without any utility function in one go using a boolean comparison and vectorisation
Another option is using a simpler utility function, written to be used with just one scalar and called vectorized.
Here are two example for that kind of utility function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for all advices, issue is solved.
Regards,
Bogdan
