Unresolved Error: Vector Creation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Unresolved Error: Vector Creation
Hiya,
Kindly can anyone resolve error shown in the image below.
The code is simple creating a vector from random numbers. Before it was working fine, untill I added another for loop below.
Thanks and Regards
Solved! Go to Solution.
- Labels:
-
Statistics_Analysis
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Near the top of the program structure you have time_err with a single subscript, i, so Mathcad thinks it's a vector. Near the bottom you have time_err with 2 sub scripts L and m so Mathcad thinks it's a matrix. Get these two consistent and the program should work.
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Delete the local assigment and both black stre and just leave the expression which is in red now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
No change, same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Upload your worksheet. Mathcad's error messages aren't always very good at telling you what is wrong, and, in particular, telling you where something has gone wrong. (Have you right-clicked on the red area and chosen Trace Error?).
Alan
- 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
Near the top of the program structure you have time_err with a single subscript, i, so Mathcad thinks it's a vector. Near the bottom you have time_err with 2 sub scripts L and m so Mathcad thinks it's a matrix. Get these two consistent and the program should work.
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks, but isn't Mathcad dynamically locate sizes. as in start I assigned one dimension but later
assigned two dimensions.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mathcad will dynamically resize. However, once it has constructed a matrix, the next time you give it just a single row index, i, how is it to know which column to use?
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It's not the double index which throws the error but the single (vector) index in the i loop when the L-loop come to L=5.
You can see this more clearly if you delete the inline evaluation of time_err. Then Mathcad shows the error at the correct place.
