Forum FlexPro – Discuss your topic!

Import from PowerLab via MatLab

Home > Community > General > Import from PowerLab via MatLab

Viewing 7 posts - 1 through 7 (of 7 total)
  • Autor
    Beiträge
  • #12657

    I have two data acquisition systems – one from AstroMed for which I use FlexPro for analysis and the second from ADInstruments, a PowerLab system. I would like to do most of my analysis with FlexPro and am trying to transfer data from the PowerLab format to FlexPro. The PowerLab can export to MatLab format, so I thought this would be a reasonable way to transfer data (PowerLab to MatLab, MatLab to FlexPro). Unfortunately this does not seem to be working for me. Either the exported data is not 100% correctly formatted for MatLab or the import algorithm does not import the data correctly.

    These are the problems:

    1) The data and “ticktimes” are imported as a data-matrix with n data-series with 1 element each instead of a data-series with n elements

    2) The comments are imported as strings with a value of “0”

    Ideally the import should create a signal with the appropriate x (ticktimes) and y (data) values. The comments should be converted into markers with the text set to the string of the comments.

    I have attached the exported file. As I do not own MatLab I cannot open the exported file to see if it was exported correctly.

    Thanks,

    Paul Warshawsky

    #8320

    I have two data acquisition systems – one from AstroMed for which I use FlexPro for analysis and the second from ADInstruments, a PowerLab system. I would like to do most of my analysis with FlexPro and am trying to transfer data from the PowerLab format to FlexPro. The PowerLab can export to MatLab format, so I thought this would be a reasonable way to transfer data (PowerLab to MatLab, MatLab to FlexPro). Unfortunately this does not seem to be working for me. Either the exported data is not 100% correctly formatted for MatLab or the import algorithm does not import the data correctly.

    These are the problems:

    1) The data and “ticktimes” are imported as a data-matrix with n data-series with 1 element each instead of a data-series with n elements

    2) The comments are imported as strings with a value of “0”

    Ideally the import should create a signal with the appropriate x (ticktimes) and y (data) values. The comments should be converted into markers with the text set to the string of the comments.

    I have attached the exported file. As I do not own MatLab I cannot open the exported file to see if it was exported correctly.

    Thanks,

    Paul Warshawsky

    #9068
    Bernhard KantzBernhard Kantz
    Teilnehmer

    The columns of an Matlab array are equal to the number of data series and the the rows of an Matlab array are equal to the number of values.
    If the matrix has only one column FlexPro imports the Matlab matrix as data series.
    In your case the matrix has one row and N columns. Therefore the result is a matrix with N data series.

    But you can convert the matrix ‘Matrix’ into a data series with this FPScript formula:

    
    Dim t
    t = TransposeMatrix(Matrix)
    t[0]
    

    In FlexPro 7 you can write

    
    TransposeMatrix(Matrix)[0]
    

    Support@weisang.com

    #9069

    I’m now using FlexPro 7.0 – I have additional problems with importing from MatLab. All string data (titles, units, comtext) seem to be truncated after the first letter! (Again I cannot be sure this is not related to how the data was exported from my the PowerLab software.) It seems to me that the import algorithm should format the data in a usable format automatically! The ticktimes should be transposed and defined to be x-values. Each channel should be transposed, named according to the titles matrix, assigned units according to the units matrix, defined to be a y-value and have the ticktimes assigned as the x-value.

    I’m sure I can eventually accomplish all this on my own with VBA, but I think it would be easier to do this as the data is imported.

    Is there a way that I can modify the import algorithm? Where would I find it? (I assume it is in VBA)

    Thanks,

    Paul

    #9070
    Bernhard KantzBernhard Kantz
    Teilnehmer

    The Matlab format is a very generic format. So it’s not possible to do the steps automatically you need in your special case.

    But you can create your own import filter with VBA. Take a look at the ImportFilter example (ImportFilter.FPD) for a sample import filter of a custom binary format. This example can be modified to fit your needs. Instead of the BinaryDataLink object you can use the MathWorksMATLABDataLink object.

    Support@weisang.com

    #9071

    I have verified that the files are being exported to MatLab format correctly. FlexPro is not importing the string data correctly (this issue was not addressed in your previous replies.) Again this means that channel names, unit names and comments are being lost in the import.

    I will look into creating my own import filter as you have suggested. Since the output from the PowerLab software uses standardized names, I believe in my specific case it will be possible.

    Thanks again,

    Paul

    #9072
    Bernhard KantzBernhard Kantz
    Teilnehmer

    We are using the C MAT-File API to import the MAT-files Version 5. We’ve tested the import with a lot of other MAT files with character arrays…

    In Matlab you also have to write a program (M-File) which imports your PowerLab Mat-files correctly. Such an M-File can be used to plot the Export Matlab MAT-files with an appearance similar to the display of the original data.
    In FlexPro you can do this with VBA.

    Support@weisang.com

Viewing 7 posts - 1 through 7 (of 7 total)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.