Announcement

Collapse
No announcement yet.

Matlab format support?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Matlab format support?

    Dear all,

    before I start something new, I wanted to ask if Matlab is already supported as file format. I think this would be something great and most likely helpful for a lot of people.

    If not, may I ask what's the best way to do it? I would probably start with the format rules for C/C++ and modify them so they match Matlab M-Code. I am not sure how complex this will be... but I'd give it a try...

    With regards, Morten.

  • #2
    Hello,

    We do not have a matlab rule, but it has come up once before here:
    http://www.scootersoftware.com/vbull...ead.php?t=3095

    If you create a custom matlab rule, please feel free to email it to us at [email protected] and we may use it for research or host it as an additional download.

    Here are a couple KB articles on defining custom rules, and creating unimportant text:
    http://www.scootersoftware.com/suppo...rnalconversion
    http://www.scootersoftware.com/suppo..._unimportantv3
    Aaron P Scooter Software

    Comment


    • #3
      Does Beyond Compare have support for look ahead or look behind? In Matlab, strings are delimited by the ' character, but that character is also used as the transpose operator. The only way to differentiate the two is from the context.

      Comment


      • #4
        Hi kdunwoody,

        The best place to start with this is the link Aaron posted previously: http://www.scootersoftware.com/suppo..._unimportantv3

        You can define grammar for a file format using delimiters or regular expressions. Delimiters support escape characters, so it might work if the transpose operator is escaped. It also might be possible to come up with a regular expression that works.

        If you're having trouble defining a file format, you're welcome to send a pair of example files to [email protected] and we'll try to help out.
        Chris K Scooter Software

        Comment


        • #5
          DONE!!!

          Ok, I did it. It seems to work just fine, I've created two formats: One that takes RCS information into account and one that does not (the default). The RCS version will therefore handle comments differently. It can be used if you want to generally include differences in comments and exclude differences of RCS statements in comments.

          I used a huge list of keywords (that was most challenging) whereas the first part are the Matlab built-in keywords (you can obtain them in Matlab with the "iskeyword" command without an argument) and then the list that scintilla (an editor component) uses for Matlab external keywords (provided through usual M files).

          Notice that I wasn't able to find a list of all current keywords from the Mathworks homepage in a usable format (a list). The external keywords will probably get more with every Matlab version, however, the most common ones are surely included and won't change.

          I've exported both file formats and attached to this post for your convenience.

          ToDo: Escaping of the string character (') is probably not yet working correctly. However, I don't use such in my work.

          Comment


          • #6
            Morten,

            Thanks for sharing the file format. I'm sure our other users will find it very helpful.
            Chris K Scooter Software

            Comment


            • #7
              Originally posted by Chris View Post
              Thanks for sharing the file format. I'm sure our other users will find it very helpful.
              Glad you like it. If you want to, feel free to provide it through the BC3 file formats download page, or whatever you believe is appropriate. I'll get back to this thread if I see the need for an update.

              Comment


              • #8
                thanks

                Thanks, this is working great so far for me.

                Administrators,
                Could this be posted so that a login to the forums is not required?

                Thanks!

                Comment


                • #9
                  Thanks for the feedback. We'll look into adding this matlab file format additional downloads section.
                  Aaron P Scooter Software

                  Comment


                  • #10
                    You can now download the "Matlab Source" file format at http://www.scootersoftware.com/v3formats. It is available for both Windows and Linux.
                    Erik Scooter Software

                    Comment

                    Working...
                    X