cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Issue with plot - These array elements must be scalars. They cannot be vector or matrix

Ali_Ihsan
4-Participant

Issue with plot - These array elements must be scalars. They cannot be vector or matrix

Hi,

 

I have just started using Prime 7 instead of Mathcad 15 and have to convert all my files. The issue is after solving a system of equations, the solutions I get are part of the solution vector I guess. I can perform calculations but cannot plot due to the error mentioned in the title. I have seen similar topics here, but I cannot find a way to solve my issue. I figure it is simple and straightforward.

 

The file

is attached.

 

Thanks in advance.

Ali

 

ACCEPTED SOLUTION

Accepted Solutions

Hi,

Matrices of one element are formed as part of the calculations.

Capture2.JPG

Simply use the zero index to get a number for a and a complex number for d.

Capture.JPG

 

 

View solution in original post

7 REPLIES 7

Hi,

Matrices of one element are formed as part of the calculations.

Capture2.JPG

Simply use the zero index to get a number for a and a complex number for d.

Capture.JPG

 

 

Thanks a lot. I understand now. If may ask, how do I modify the graph to change the number of ticks, labels, legend,s etc. the plot bar seems quite limited.

Werner_E
25-Diamond I
(To:Ali_Ihsan)


@Ali_Ihsan wrote:

Thanks a lot. I understand now. If may ask, how do I modify the graph to change the number of ticks, labels, legend,s etc. the plot bar seems quite limited.


Yes, Primes native plots are very limited. There is no option for showing grids, labels or legends.
But, while not obvious, you can change the first, second and last value for each axis and so you can at least control the number of ticks.

 

Another option is to use the third party plot component (chart component) which PTC had (quite badly) integrated into Prime since vers version 5 instead of improving their own native plots. This component is rather slow and un-intuitive, does not support units and has its scaling problems with certain combinations of screen resolution and Windows zoom factor. But it supports a secondary y-axis, labels and legends (I think) and the display of grid lines.
So you may want to give it a try and see if it fits your need better than the native 2D-plot.

Thanks a lot. I understand now. If may ask, how do I modify the graph to change the number of ticks, labels, legend,s etc. the plot bar seems quite limited.

 

There are two ways to plot in Prime.  

a) Plots | Traces | Insert Plot -> This gives you the plot type used.

Capture.JPG

b) Math | Regions | Chart Component -> This gives a more adjustable plot.

Capture2.JPG

The chart component when you double click it brings up the edit window of the plot.

In edit window you can change number of ticks, add labels, add legends etc

 

I have added a chart component in the file to show you.

Capture3.JPG

Capture4.jpg

Cheers

Terry

 

Cheers Terry

 

 

That is very helpful. Thank you very much.

 

Cheers,

Ali

Werner_E
25-Diamond I
(To:Ali_Ihsan)

You used the column selector to access the individual elements of the 1 x 4 matrix calculated by MM(Gamma,kL).

Werner_E_0-1642247831232.png

That way you always get a column, a matrix, even if its only one row high (1 x 1 matrix).

 

You should rather use normal matrix indices

Werner_E_1-1642247879259.png

or you may also assign the output of MM(Gamma,kL) to a 4 x 1 matrix of individual variables:

Werner_E_2-1642247946938.png

 

 

 

Ali_Ihsan
4-Participant
(To:Werner_E)

This work as well. I understand the underlying issue now. Thanks a lot. I appreciate the help.

Announcements

Top Tags