Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question.
X

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Sep 20, 2018
08:42 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Sep 20, 2018
08:42 AM

Warning: These array elements must be scalar. They cannot be vectors or matrices

Hallo Everybody,

My name is Yudi. I am a student and I newbie using Mathcad Prime software. I have a problem so I hope somebody can give me a solution. I using this software for analysis RC beam and after I get the result, I compare with experiment data. The problem is I can not transfer the result in the plot because there is a warning "These array elements must be scalar. They cannot be vectors or matrices". I have searching in other reference and I try to apply the method but the warning still appears.

Solved! Go to Solution.

ACCEPTED SOLUTION

Accepted Solutions

Sep 20, 2018
05:50 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Sep 20, 2018
05:50 PM

Two problems in your sheet:

1) in one place you used a square bracket instead of a pair of parentheses. Square brackets create a vector/matrix. Thats the reason Ft and Mt are vectors consisting of 1x1 matrices

2) At the end you should not return the calculated vectors by putting them into a 1x5 vector as this creates a nested vectors structure and you would have to use D[0,2 to get the vector Ft.

It seems to be cleaner to create just a big matrix using augment. That way you can access the vectors the same way you tried anyway.

Worksheet in Prime 5 format attached.

5 REPLIES 5

Sep 20, 2018
11:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Sep 20, 2018
11:36 AM

The output of your program ( D:=... ) is a row-array containing vectors as elements.

You assign the first element to epsilon.0, and it becomes a vector (=column-array) of 1 element {due to the way you pick it out of D}. That one element is a vector with 31 elements. Had you assigned epsilon.0:=D[0,0 it would have become a simple vector.

You are trying to plot M.t, take as is the fourth element of D, and (again due to the way you picked it out of D) is a (1 element) vector, containing a 31-element vector, that contains one value of 0 and the remaining 30? elements are each 1-element vectors.

Your Phi has similar problems.

Mathcad (and Prime is no better, nor worse than that) can ONLY plot vectors and scalars (not vectors containing vectors containing...).

You'll have to restructure your program, to assure that (ideally) D contains only 5 vectors, or that all data is contained in a single matrix.

Success!

Luc

Sep 20, 2018
09:06 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Sep 20, 2018
09:06 PM

Thank you for your suggestion. I will try to modification my program again.

Sep 20, 2018
05:50 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Sep 20, 2018
05:50 PM

Two problems in your sheet:

1) in one place you used a square bracket instead of a pair of parentheses. Square brackets create a vector/matrix. Thats the reason Ft and Mt are vectors consisting of 1x1 matrices

2) At the end you should not return the calculated vectors by putting them into a 1x5 vector as this creates a nested vectors structure and you would have to use D[0,2 to get the vector Ft.

It seems to be cleaner to create just a big matrix using augment. That way you can access the vectors the same way you tried anyway.

Worksheet in Prime 5 format attached.

Sep 20, 2018
09:05 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Sep 20, 2018
09:05 PM

Thank you very much Mr. Werner_E for your solution. It's working. I just know function of "Augment". Once again thank you very much.

Sep 21, 2018
02:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Sep 21, 2018
02:27 AM

You are welcome.

I think its a better and more versatile way for the function to return the row vector of result vectors as you did it in the first place instead of the matrix created by augment as I suggested.

Its quite easy to separate the five vectors as you can see in the picture and you even can omit the variable D completely if you write [e c Ft Mt phi] in front of the program instead of D if you like.