Skip to content

Navigation Menu

Sign in
Sign up

Utilities.Streams.writeRealMatrix seems to not work properly #4198

Unanswered
mpradovelasco asked this question in Q&A
Discussion options

Hi,

I have a block component that writes in a mat file using the following code:

String dataName(start = getInstanceName() + "_dsignal", fixed = true);
algorithm 
 /* Write */
 when terminal() and saveToFile then
 dataName := Utilities.Strings.replace(dataName, ".", "_");
 success := Utilities.Streams.writeRealMatrix(fileName, dataName, 
 dataSignal, format=format, append=true);
 end when;

The first line simply substitutes "." by "_" for matlab compatibility. I use two instances of this block in a model (Maximums and Minimums):

image

in such a way that two dataName strings are properly generated: "ModelName_Minimums_dsignal" and "ModelName_Maximums_dsignal". dataSignal is the matrix to be saved, which is properly defined.

In the case that the file does not exist, only one component writes in the file, despite the names of arrays to write are different and argument append = true. That is:
image

If the file exist, no one writes in the file (in that case Matlab indicates that mat file is empty). I have tried with different Mat formats and append values without success.

Can someone help me?

System: MSL 4.0.0 on OMEdit 1.22 dev and Windows 11.

Thanks!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /