What format requirements do we need to establish matrix in MATLAB for “ImportMatricesFromMatlab” module? #2315
Replies: 13 comments
-
This module is really built to accompany a specific opimization module that hasn't been ported to SR5 yet. Sounds like you want the RMS error, not the relative RMS. It might be easiest to use the InterfaceWithPython. There are instructions on the Python interface here. You can get the norm of the difference, a similar value, using EvaluateLinearAlgebraBinary to get the difference and ReportMatrixSliceMeasure to get the norm of each row/column of that matrix. Getting the RMS error is easiest if they are vectors assigned to fields, then the CalculateFieldData module could be used. |
Beta Was this translation helpful? Give feedback.
-
thank you for your detailed explanation! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
What format requirements do we need to establish matrix in MATLAB for “ImportMatricesFromMatlab” module? |
Beta Was this translation helpful? Give feedback.
-
I can't read the text in the InterfaceWithPython module. If you past the code that you have in there, perhaps I can help with that |
Beta Was this translation helpful? Give feedback.
-
the InterfaceWithMatlab module just takes matrices saved in a matlab format and allows you to select them from a list. The only caveat is that the matrices have to be 2D, and they can't be cell arrays or part of a structure array. You can save these out from SCIRun, Matlab, or Python with scipy.io. If you are still having trouble, perhaps you could include a small example file that isn't working for you. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
For the InterfaceWithPython module, I also have an example program,whose code is as follows. |
Beta Was this translation helpful? Give feedback.
-
Looks like you save the matlab matrix in an HDF format, which isn't supported in SCIRun. Try saving it with the save function with normal compression. |
Beta Was this translation helpful? Give feedback.
-
Using numpy to compute the RMSE is fine, you'll just need to convert the matrix back to a list to send it back to SCIRun. Line 15 should be:
since this case is a single value, you'll need double brackets to make it a list of lists.
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your detailed reply. Both problems have been solved. |
Beta Was this translation helpful? Give feedback.
-
I want to bulid two matrices in the “ImportMatricesFromMatlab” module, and put this matrices into "ReportColumnMatrixMisfit" module,and get the root mean square error(RMSE).
Here, I have two questions.
First, What format requirements do I need to establish matrices in MATLAB for “ImportMatricesFromMatlab” module?
Secondly, Dose "Rel RMS" in "ReportColumnMatrixMisfit" module mean root mean square error(RMSE)?
Beta Was this translation helpful? Give feedback.
All reactions