OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000550OMNeT++IDE / result analysispublic2012-03-10 21:382012-03-13 15:08
jlizquierdo 
rhornig 
normaltrivialN/A
resolvedfixed 
4.2.1 
4.2.2 
0000550: Error in export as matlab script
When you export a vector from result analysis feature to a matlab script and then import it in matlab an error is thrown:

Error: File: exportError.m Line: 1 Column: 26
The input character is not valid in MATLAB statements or expressions.

The content of exportError.m is:

measured_RTT.description=""
measured_RTT.X=[
0.112496266666;
0.172247733332;

...

589.240920444581;
589.486536444581;
]

measured_RTT.Y=[
0.059789066666;
0.0597514666660000013;

...

0.239904000000000006;
0.245616000000000001;
]


The point is Matlab uses single quotes for strings instead of double quotes:

measured_RTT.description="" must be measured_RTT.description=''
No tags attached.
Issue History
2012-03-10 21:38jlizquierdoNew Issue
2012-03-10 22:14jlizquierdoNote Added: 0000726
2012-03-12 14:20rhornigNote Added: 0000731
2012-03-12 14:20rhornigStatusnew => resolved
2012-03-12 14:20rhornigFixed in Version => 4.2.2
2012-03-12 14:20rhornigResolutionopen => fixed
2012-03-12 14:20rhornigAssigned To => rhornig
2012-03-13 15:08rhornigNote Added: 0000739
2012-03-14 22:32andrasNote Edited: 0000739

Notes
(0000726)
jlizquierdo   
2012-03-10 22:14   
It seems the problem is on src/scave/export.cc:

string MatlabStructExport::quoteString(const string &str)
{
    string result;
    result.push_back('"'); // <-- here
    for (string::const_iterator it = str.begin(); it != str.end(); ++it)
    {
        if (*it == '\\' || *it == '\"')
            result.push_back('\\');
        result.push_back(*it);
    }
    result.push_back('"'); // <-- and here

    return result;
}
(0000731)
rhornig   
2012-03-12 14:20   
Fixed the quotation mark. changed from " to '. Also escaping was wrong ' is quoted as '' not as \'
(0000739)
rhornig   
2012-03-13 15:08   
(edited on: 2012-03-14 22:32)
After some investigation, we have removed the matlab script output from the IDE, as it was broken.

CSV files can be used to import data to matlab.