|
From: Eric L. <Eri...@ma...> - 2017-11-06 17:49:50
|
It looks like an echoing feature is turned on, where input into ML is echo'd back out again. There's a variable for describing what ML does since the echo depends on platform or some-such. I think it's been 't' for a long time.
Maybe in your cleaned code, put all the code on one line with no CRs, and sub in a , when there is no line ending. Then you could clean out the input code.
Alternately, put it into a tmp file as before, and run that, and clean out the name of the tmp command.
I don't have a Linux box to test my MATLABs on to fiddle around with echo features. Sorry.
Eric
From: Uwe Brauer [mailto:ou...@ma...]
Sent: Saturday, November 04, 2017 11:35 AM
To: Eric Ludlam <Eri...@ma...>
Cc: matlab-emacs-discuss <mat...@li...>
Subject: almost doneRe: [Matlab-emacs-discuss] executing matlab in org mode files (using the matlab-shell)
On 11/03/2017 03:47 PM, Eric Ludlam wrote:
Ah, sorry I can't be more help. It has been many years since I worked on that code, and I don't use Emacs much anymore. There are accommodations in the function's I referenced for the ML command line to make sure it doesn't interrupting anything a user might be typing in that would be important for your use case.
Ok fair enough. I think I made some progress but still have a small
problem, maybe you might remember and help. :-D
John's code consists of:
- cleaning the matlab code in orgmode mode: (font lock stuff etc)
and collect it.
- create a temporally file and insert the clean matlab commands.
- run a external matlab process via
"/usr/local/bin/matlab " "-nodesktop <" m-file
- clean the result and insert it in the original buffer.
So my solution is to use the matlab-shell-collect-command-output
function. So my code is:
- cleaning the matlab code in orgmode mode: (font lock stuff etc)
and collect it.
- run (matlab-shell-collect-command-output code) where code
corresponds to the clean code from step one which John inserts in
temp buffer.
- clean the result and insert it in the original buffer.
The only problem is that the output of the
/usr/local/bin/matlab -nodesktop < m-file
And (matlab-shell-collect-command-output code)
is slightly different.
Take the following example.
f=@(t,y)[-t*y^2];
[t,y]=ode45(f,[0 1],1);
t=[t(1),t(end)];
y=[y(1),y(end)];
disp('\begin{align*}')
fprintf('t = [%g \\quad<file://quad> %g] \\\\\n<file://n>', t)
fprintf('y = [%g \\qquad<file://qquad> %g] \n', y)
disp('\end{align*}')
The external matlab command does not include the fprintf in his output.
I have collected the output of both approaches including the result of
the cleaning function.
So there are two possibilities.
- Modify matlab-shell-collect-command-output so that it behaves closer to
/usr/local/bin/matlab -nodesktop < m-file
- modify the cleaning function (which I don't understand but could
ask John about it).
(when results
;; strip out >>
(setq results (replace-regexp-in-string ">> " "" results))
;; remove first 10 lines that are the header.
(setq results (mapconcat 'identity
(nthcdr 10 (split-string results "\n"))
"\n")))
Any comment is more than welcome. Here is the output of both commands
Uwe
1 Matlab and the cleaning
1.1 Result Matlab (John)
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n<http://www.mathworks.com./n/n>>> >> >> >> >> \\begin{align*}\n<file://begin%7balign*%7d/n>>> t = [0 \\quad1<file://quad1>] \\\\\n<file://n>>> y = [1 \\qquad0.666667<file://qquad0.666667>] \n>> \\end{align*}\n<file://end%7balign*%7d/n>>> "
Stop
[2 times]
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n<http://www.mathworks.com./n/n>>> >> >> >> >> \\begin{align*}\n<file://begin%7balign*%7d/n>>> t = [0 \\quad1<file://quad1>] \\\\\n<file://n>>> y = [1 \\qquad0.666667<file://qquad0.666667>] \n>> \\end{align*}\n<file://end%7balign*%7d/n>>> "
[3 times]
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n<http://www.mathworks.com./n/n>>> >> >> >> >> \\begin{align*}\n<file://begin%7balign*%7d/n>>> t = [0 \\quad1<file://quad1>] \\\\\n<file://n>>> y = [1 \\qquad0.666667<file://qquad0.666667>] \n>> \\end{align*}\n<file://end%7balign*%7d/n>>> "
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n\\begin<http://www.mathworks.com./n/n/begin>{align*}\nt= [0 \\quad1<file://quad1>] \\\\\ny<file://ny>= [1 \\qquad0.666667<file://qquad0.666667>] \n\\end{align*}\n"
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n\\begin<http://www.mathworks.com./n/n/begin>{align*}\nt= [0 \\quad1<file://quad1>] \\\\\ny<file://ny>= [1 \\qquad0.666667<file://qquad0.666667>] \n\\end{align*}\n"
[5 times]
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n\\begin<http://www.mathworks.com./n/n/begin>{align*}\nt= [0 \\quad1<file://quad1>] \\\\\ny<file://ny>= [1 \\qquad0.666667<file://qquad0.666667>] \n\\end{align*}\n"
Result: (#1="" " < M A T L A B (R) >" " Copyright 1984-2012 The MathWorks, Inc." " R2012a (7.14.0.739) 32-bit (glnx86)" " February 9, 2012" #1# " " "To get started, type one of these: helpwin, helpdesk, or demo." "For product information, visit www.mathworks.com<http://www.mathworks.com>." " " "\\begin{align*}<file://begin%7balign*%7d>" "t = [0 \\quad1<file://quad1>] \\\\" "y = [1 \\qquad0.666667<file://qquad0.666667>] " "\\end{align*}<file://end%7balign*%7d>" #1#)
1.2 Result cleaning (John)
Result: ("\\begin{align*}<file://begin%7balign*%7d>" "t = [0 \\quad1<file://quad1>] \\\\" "y = [1 \\qquad0.666667<file://qquad0.666667>] " "\\end{align*}<file://end%7balign*%7d>" "")
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
[2 times]
Result: ("replace" "output" "latex")
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
1.3 Result Matlab (Shell)
Result: "f=@(t,y)[-t*y2];\n[t,y]=ode45(f,[0 1],1);\nt=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\nfprintf('t = [%g \\\\quad%g] \\\\\\\\\\n', t)\nfprintf('y = [%g \\\\qquad%g] \\n', y)\ndisp('\\end{align*}')\n"
Result: ">> [t,y]=ode45(f,[0 1],1);\n>> t=[t(1),t(end)];\n>> y=[y(1),y(end)];\n>> disp('\\begin{align*}')\n\\begin{align*}\n>> fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\n<file://n>>> fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \n>> disp('\\end{align*}')\n\\end{align*}\n>> \n>> \n"
[2 times]
Result: ">> [t,y]=ode45(f,[0 1],1);\n>> t=[t(1),t(end)];\n>> y=[y(1),y(end)];\n>> disp('\\begin{align*}')\n\\begin{align*}\n>> fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\n<file://n>>> fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \n>> disp('\\end{align*}')\n\\end{align*}\n>> \n>> \n"
[3 times]
Result: ">> [t,y]=ode45(f,[0 1],1);\n>> t=[t(1),t(end)];\n>> y=[y(1),y(end)];\n>> disp('\\begin{align*}')\n\\begin{align*}\n>> fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\n<file://n>>> fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \n>> disp('\\end{align*}')\n\\end{align*}\n>> \n>> \n"
Result: "[t,y]=ode45(f,[0 1],1);\nt=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Result: "[t,y]=ode45(f,[0 1],1);\nt=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
[5 times]
Result: "[t,y]=ode45(f,[0 1],1);\nt=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Result: ("[t,y]=ode45(f,[0 1],1);" "t=[t(1),t(end)];" "y=[y(1),y(end)];" "disp('\\begin{align*}')" "\\begin{align*}<file://begin%7balign*%7d>" "fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)" "t = [0 \\quad1<file://quad1>] \\\\" "fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)" "y = [1 \\qquad0.666667<file://qquad0.666667>] " "disp('\\end{align*}')" "\\end{align*}<file://end%7balign*%7d>" #1="" #1# #1#)
1.4 Result cleaning
Result: ("t=[t(1),t(end)];" "y=[y(1),y(end)];" "disp('\\begin{align*}')" "\\begin{align*}<file://begin%7balign*%7d>" "fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)" "t = [0 \\quad1<file://quad1>] \\\\" "fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)" "y = [1 \\qquad0.666667<file://qquad0.666667>] " "disp('\\end{align*}')" "\\end{align*}<file://end%7balign*%7d>" #1="" #1# #1#)
Result: "t=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Result: "t=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Result: "t=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Created: 2017-11-04 Sat 15:26
Validate<http://validator.w3.org/check?uri=referer>
1 Matlab and the cleaning
1.1 Result Matlab (John)
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n<http://www.mathworks.com./n/n>>> >> >> >> >> \\begin{align*}\n<file://begin%7balign*%7d/n>>> t = [0 \\quad1<file://quad1>] \\\\\n<file://n>>> y = [1 \\qquad0.666667<file://qquad0.666667>] \n>> \\end{align*}\n<file://end%7balign*%7d/n>>> "
Stop
[2 times]
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n<http://www.mathworks.com./n/n>>> >> >> >> >> \\begin{align*}\n<file://begin%7balign*%7d/n>>> t = [0 \\quad1<file://quad1>] \\\\\n<file://n>>> y = [1 \\qquad0.666667<file://qquad0.666667>] \n>> \\end{align*}\n<file://end%7balign*%7d/n>>> "
[3 times]
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n<http://www.mathworks.com./n/n>>> >> >> >> >> \\begin{align*}\n<file://begin%7balign*%7d/n>>> t = [0 \\quad1<file://quad1>] \\\\\n<file://n>>> y = [1 \\qquad0.666667<file://qquad0.666667>] \n>> \\end{align*}\n<file://end%7balign*%7d/n>>> "
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n\\begin<http://www.mathworks.com./n/n/begin>{align*}\nt= [0 \\quad1<file://quad1>] \\\\\ny<file://ny>= [1 \\qquad0.666667<file://qquad0.666667>] \n\\end{align*}\n"
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n\\begin<http://www.mathworks.com./n/n/begin>{align*}\nt= [0 \\quad1<file://quad1>] \\\\\ny<file://ny>= [1 \\qquad0.666667<file://qquad0.666667>] \n\\end{align*}\n"
[5 times]
Result: "\n< M A T L A B (R) >\nCopyright 1984-2012 The MathWorks, Inc.\nR2012a (7.14.0.739) 32-bit (glnx86)\nFebruary 9, 2012\n\n\nToget started, type one of these: helpwin, helpdesk, or demo.\nForproduct information, visit www.mathworks.com.\n\n\\begin<http://www.mathworks.com./n/n/begin>{align*}\nt= [0 \\quad1<file://quad1>] \\\\\ny<file://ny>= [1 \\qquad0.666667<file://qquad0.666667>] \n\\end{align*}\n"
Result: (#1="" " < M A T L A B (R) >" " Copyright 1984-2012 The MathWorks, Inc." " R2012a (7.14.0.739) 32-bit (glnx86)" " February 9, 2012" #1# " " "To get started, type one of these: helpwin, helpdesk, or demo." "For product information, visit www.mathworks.com<http://www.mathworks.com>." " " "\\begin{align*}<file://begin%7balign*%7d>" "t = [0 \\quad1<file://quad1>] \\\\" "y = [1 \\qquad0.666667<file://qquad0.666667>] " "\\end{align*}<file://end%7balign*%7d>" #1#)
1.2 Result cleaning (John)
Result: ("\\begin{align*}<file://begin%7balign*%7d>" "t = [0 \\quad1<file://quad1>] \\\\" "y = [1 \\qquad0.666667<file://qquad0.666667>] " "\\end{align*}<file://end%7balign*%7d>" "")
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
[2 times]
Result: ("replace" "output" "latex")
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
Result: "\\begin{align*}\nt= [0 \\quad1] \\\\\ny= [1 \\qquad0.666667] \n\\end{align*}\n<file://begin%7balign*%7d/nt=%20%5b0%20/quad1%5d%20/ny=%20%5b1%20/qquad0.666667%5d%20/n/end%7balign*%7d/n>"
1.3 Result Matlab (Shell)
Result: "f=@(t,y)[-t*y2];\n[t,y]=ode45(f,[0 1],1);\nt=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\nfprintf('t = [%g \\\\quad%g] \\\\\\\\\\n', t)\nfprintf('y = [%g \\\\qquad%g] \\n', y)\ndisp('\\end{align*}')\n"
Result: ">> [t,y]=ode45(f,[0 1],1);\n>> t=[t(1),t(end)];\n>> y=[y(1),y(end)];\n>> disp('\\begin{align*}')\n\\begin{align*}\n>> fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\n<file://n>>> fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \n>> disp('\\end{align*}')\n\\end{align*}\n>> \n>> \n"
[2 times]
Result: ">> [t,y]=ode45(f,[0 1],1);\n>> t=[t(1),t(end)];\n>> y=[y(1),y(end)];\n>> disp('\\begin{align*}')\n\\begin{align*}\n>> fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\n<file://n>>> fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \n>> disp('\\end{align*}')\n\\end{align*}\n>> \n>> \n"
[3 times]
Result: ">> [t,y]=ode45(f,[0 1],1);\n>> t=[t(1),t(end)];\n>> y=[y(1),y(end)];\n>> disp('\\begin{align*}')\n\\begin{align*}\n>> fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\n<file://n>>> fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \n>> disp('\\end{align*}')\n\\end{align*}\n>> \n>> \n"
Result: "[t,y]=ode45(f,[0 1],1);\nt=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Result: "[t,y]=ode45(f,[0 1],1);\nt=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
[5 times]
Result: "[t,y]=ode45(f,[0 1],1);\nt=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Result: ("[t,y]=ode45(f,[0 1],1);" "t=[t(1),t(end)];" "y=[y(1),y(end)];" "disp('\\begin{align*}')" "\\begin{align*}<file://begin%7balign*%7d>" "fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)" "t = [0 \\quad1<file://quad1>] \\\\" "fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)" "y = [1 \\qquad0.666667<file://qquad0.666667>] " "disp('\\end{align*}')" "\\end{align*}<file://end%7balign*%7d>" #1="" #1# #1#)
1.4 Result cleaning
Result: ("t=[t(1),t(end)];" "y=[y(1),y(end)];" "disp('\\begin{align*}')" "\\begin{align*}<file://begin%7balign*%7d>" "fprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)" "t = [0 \\quad1<file://quad1>] \\\\" "fprintf('y = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)" "y = [1 \\qquad0.666667<file://qquad0.666667>] " "disp('\\end{align*}')" "\\end{align*}<file://end%7balign*%7d>" #1="" #1# #1#)
Result: "t=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Result: "t=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Result: "t=[t(1),t(end)];\ny=[y(1),y(end)];\ndisp('\\begin{align*}')\n\\begin{align*}\nfprintf('t = [%g \\\\quad%g<file://quad%25g>] \\\\\\\\\\n<file://n>', t)\nt= [0 \\quad1<file://quad1>] \\\\\nfprintf('y<file://nfprintf('y> = [%g \\\\qquad%g<file://qquad%25g>] \\n<file://n>', y)\ny= [1 \\qquad0.666667<file://qquad0.666667>] \ndisp('\\end{align*}')\n\\end{align*}\n\n\n"
Created: 2017-11-04 Sat 15:26
Validate<http://validator.w3.org/check?uri=referer>
|