Get Help

Turn on suggestions

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

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Warning: These array elements must be scalar. They...

Options

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

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

Showing results for

Highlighted

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

09-20-2018
08:42 AM

09-20-2018
08:42 AM

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

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

09-20-2018
05:50 PM

09-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

Highlighted
##

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

09-20-2018
11:36 AM

09-20-2018
11:36 AM

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

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

Highlighted
##

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

09-20-2018
09:06 PM

09-20-2018
09:06 PM

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

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

Highlighted

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

09-20-2018
05:50 PM

09-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.

Highlighted
##

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

09-20-2018
09:05 PM

09-20-2018
09:05 PM

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

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.

Highlighted
##

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

09-21-2018
02:27 AM

09-21-2018
02:27 AM

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

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.