simple doubt using two for
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
simple doubt using two for
Hello, I have a problem with my file and I don't know how to solve it. It should be pretty simple, but I don't know how to solve it. I'm including the files and my program. My question is as follows. In the first for (counter j), when it starts from zero to 3, it gives me some values, when I start from 3 to 3, it gives me another value.
Somebody can help me?
Thanks
Solved! Go to Solution.
- Labels:
-
Programming
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Resetting h_maior for every run of the outer loop should do the trick.
You may assign it any scalar value or, like I did, NaN.
The reason why this is necessary is because the number of rows (iteration steps of the inner loop) differ and of a lower number follows a higher one, not all data of the previous vector h_maior is overwritten.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Looks like you forgot to attach your Mathcad sheet. I just see your four data files attached.
Its also not clear to me what the goal of the program seen in your pic is.
You assign the very same value in every row of matrix H and then you calculate the mean value (which obviously will be this very value)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Resetting h_maior for every run of the outer loop should do the trick.
You may assign it any scalar value or, like I did, NaN.
The reason why this is necessary is because the number of rows (iteration steps of the inner loop) differ and of a lower number follows a higher one, not all data of the previous vector h_maior is overwritten.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
it is true. I will use this sheet to do other calculations, in this part, that i sent, i am testing my sheet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you, its works very well.
