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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

matrix definition and writing file

RM_10584029
4-Participant

matrix definition and writing file

Hello to everybody. I am a user of MATHCAD Prime 8.0

I defined a matrix as a result of computations performed in my code, where three columns have been filled with frequency (in Hz or sec-1), and the real and imaginary part of a wave-vector (k' and k'') and several lines (801).

I was firstly surprised to see that if I define each column in a loop I receive back the notification that the variable has been "re-defined". The loop is below, with green-circled matrix element that receive this comment

RM_10584029_0-1683193494505.png

In spite of this, the matrix is correctly filled, as I check by using  the statement "K=".

On the other hand, when I try to save data in a file, I tried to use both "WRITETEXT" and "WRITEFILE", but the result is that the "K" matrix has no compatibility because of the units (see below)

RM_10584029_2-1683194357135.png

 

Now, the three columns have different physical dimensions, but they are correctly defined and I already used this statement in past releases (MATHCAD 15, before the PRIME) without any negative comment.

Do you see anything wrong in my statements?

 

 

 

2 REPLIES 2

Unfortunately you can only export data without units. The matrix must be dimension-less, scalar values only!

You can use something like

Werner_E_0-1683204544379.png

to strip the units. You have to use vectorization and be aware, that Prime would use the standard/default units only, not the ones you may have used when your values were defined (12 min would end up as 720 in the file).

 


 I already used this statement in past releases (MATHCAD 15, before the PRIME) without any negative comment.

NO! You didn't!
MC15 is still superior to Prime and more comfortable to use, but you sure did not use this statement that way in good old MC15!

1) Neither WRITETEXT nor WRITEFILE were implemented in MC15 (we had READFILE, though)

2) MC15 would not allow matrices with quantities of different dimensions (units)

3) MC15 did not provide export functions which would export the units as well. WRITEPRN, WRITEBIN, WRITEEXCEL ... all of them would refuse to export a matrix which contained units. The error message is a bit more meaningful in MC15

Werner_E_1-1683205256612.png

 

RM_10584029
4-Participant
(To:Werner_E)

Thank you  for your reply.

In fact, you are right, the files I did previously with MCAD 15 did not contain any physical unit, but just numbers!

So far, using units is very convenient from a physical standpoint to avoid ambiguities in the solution of a problem, and it is a pity that what you calculated before cannot be saved in a file with proper units. Actually, the matrix can include them. Then, I am forced in re-defining some quantities without units just to export the results.

 

Thank you very much for your help, now I shall try this solution.

Top Tags