How to name the columns of the csv file exported using 'Scope' or 'To File' ?

I am exporting a csv file using the following probe before a Scope/ToFile block.

The columns of the exported csv file are as shown below.

As you can see there are two columns with the same name ‘Capacitor voltage’. When I import this as a table in my MATLAB script for post-processing and analysis, it is a bit difficult to handle this situation. Is there a workaround where the above columns will be named something like ‘C1_Capacitor voltage’, ‘R2_Resistor current’, and ‘C2_Capacitor voltage’?

Hello,

You could place the components of interest inside a Masked Subsystem, and add their respective signals of interest as Mask Probe Signals, with your own custom names. Do you know how to do this?

Regards,
Kris

Thanks for the suggestion, Kris!

I was able to do that. Although I have to carefully name each mask signal of my interest.

Let me pick your brain a bit more, please. I have created a masked subsystem out of a simple inductor as shown below.

Is there any way I can name the mask signals with a reference to the ‘Path’ of the probed component as highlighted red in the above figure? If this is possible, then I can use this masked subsystem as many times as I want in my circuit without worrying to name the probe signals individually. I am kind of hoping there is a solution here.

Hi again,

Unfortunately, I don’t think this is possible to include a path reference as part of the signal naming process. You will need to copy the path information into the signal name field manually.

Thanks,

Kris

Hi Kawsar,

I just wanted to update you that this has been fixed in PLECS 4.4.1. Please download the latest version here – release notes.1. The component signal tied to the Probe block now also displays the component name along with the signal name.

62. The To File block has a new parameter “Write signal names” that lets you choose whether CSV files are written with a header row containing the names of the input signals.

Additionally, there is a new From File block, that reads signal trajectories from CSV or MAT files.Regards,Manu

Thanks for the update Manu! This is very helpful.