all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 63500f223cab9e923d465e5e0ae17e877a183824 1970 bytes (raw)
name: testing/examples/ob-matlab-test.org 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
 
#+Title: A collection of examples for ob-matlab tests
#+OPTIONS: ^:nil

* Test MATLAB results output
:PROPERTIES:
:ID:       99332277-5e0e-4834-a3ad-ebcaddb855ab
:END:

#+begin_src matlab :results output
  disp('The results are:')
  a = [1, 2; 3, 4]
  b = a * 2
#+end_src

#+RESULTS:
#+begin_example
The results are:

a =

     1     2
     3     4

b =

     2     4
     6     8
#+end_example

Following validates whitespace is preserved

#+begin_src matlab :results output
  disp('  +---+')
  disp('  |one|')
  disp('  +---+')
  disp(newline)
  disp(['    ', num2str(1)]);
  disp(newline)
  disp('  +---+')
  disp('  |two|')
  disp('  +---+')
  disp(newline)
  disp(['    ', num2str(2)]);
  disp(newline)
#+end_src

* Test reuse of MATLAB buffer with results output
:PROPERTIES:
:ID:       a68db9ff-efdf-42b9-85fc-174015cd1f77
:END:

#+begin_src matlab :results output
  a = 123
#+end_src

#+RESULTS:
: a =
: 
:    123

#+begin_src matlab :exports both :results output
  b = a + 1000
#+end_src

#+RESULTS:
: b =
: 
:         1123

Following should give: Unrecognized function or variable 'b'.

#+begin_src matlab :results output
  clear
  c = b * 2
#+end_src

#+RESULTS:
: Unrecognized function or variable 'b'.

* Test results verbatim
:PROPERTIES:
:ID:       278047b6-4b87-4852-9050-e3e99fcaabb8
:END:

#+begin_src matlab :results verbatim
  a = 2 + 3;
  ans = magic(a);
#+end_src

* Test results output latex
:PROPERTIES:
:ID:       7a8190be-d674-4944-864e-6fdaa7362585
:END:

#+begin_src matlab :results output latex
  m = [4*pi, 3*pi; 2*pi, pi];
  result = latex(sym(m));
  disp(result)
#+end_src

* Test results file graphics
:PROPERTIES:
:ID:       5bee8841-a898-4135-b44b-f1bd5465ceed
:END:

#+begin_src matlab :results file graphics :file NAME.png
  t = [0 : 0.1 : 2*pi];
  y = sin(t);
  plot(t, y);
  set(gcf, 'PaperUnits', 'inches', 'PaperPosition', [0 0 4 3]) % Set the size to 4" x 3"
#+end_src


# LocalWords:  ebcaddb efdf fc fcaabb fdaa ceed sinewave

debug log:

solving 63500f223 ...
found 63500f223 in https://yhetil.org/emacs/CACb3vdSc2ypq5hdd3Kgb3K+wek-0LDwUqUPugzUr2tt5yyg23Q@mail.gmail.com/

applying [1/1] https://yhetil.org/emacs/CACb3vdSc2ypq5hdd3Kgb3K+wek-0LDwUqUPugzUr2tt5yyg23Q@mail.gmail.com/
diff --git a/testing/examples/ob-matlab-test.org b/testing/examples/ob-matlab-test.org
new file mode 100644
index 000000000..63500f223

1:64: trailing whitespace.
: 
1:73: trailing whitespace.
: 
Checking patch testing/examples/ob-matlab-test.org...
Applied patch testing/examples/ob-matlab-test.org cleanly.
warning: 2 lines add whitespace errors.

index at:
100644 63500f223cab9e923d465e5e0ae17e877a183824	testing/examples/ob-matlab-test.org

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.