<PapeCoding/>

Matrix2Wolfram Online



Matrix2Wolfram Online

As an alternative to the Visual Basic version, this tool can convert a matrix which is written in a normal matrix style (rows separated by new line and columns separated by spaces) to the Wolfram|Alpha style with curly-brackets.


Code used in this site:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function convertMat(input){
    input = input.split(/\n/); //Split lines
    var r = "";
    for(var i = 0; i < input.length; i++){
        if(i != 0){r += ",";}
        r += "{" + input[i].trim().replace(/ /g, ',') + "}";
    }
    if(input.length > 0){r ="{" +  r + "}"};
    return(r);
}