Skip to main content
1-Visitor
January 15, 2022
Solved

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

  • January 15, 2022
  • 2 replies
  • 3364 views

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

 

Best answer by terryhendicott

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

 

 

2 replies

21-Topaz II
January 15, 2022

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

 

 

Ali_Ihsan1-VisitorAuthor
1-Visitor
January 15, 2022

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.

21-Topaz II
January 15, 2022

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

 

 

25-Diamond I
January 15, 2022

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_Ihsan1-VisitorAuthor
1-Visitor
January 15, 2022

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