@@ -77,7 +77,7 @@ of the structure you can type its name, just as for any other variable:
7777@example
7878@group
7979x
80- @result {} x =
80+ @xresult {} x =
8181
8282 scalar structure containing the fields:
8383
@@ -99,7 +99,7 @@ Structures may be copied just like any other variable:
9999@example
100100@group
101101y = x
102- @result {} y =
102+ @xresult {} y =
103103
104104 scalar structure containing the fields:
105105
@@ -121,14 +121,14 @@ structure containing the single field @code{a}, which has a value of 3.
121121@example
122122x.d.a = 3;
123123x.d
124- @result {} ans =
124+ @xresult {} ans =
125125
126126 scalar structure containing the fields:
127127
128128 a = 3
129129
130130x
131- @result {} x =
131+ @xresult {} x =
132132
133133 scalar structure containing the fields:
134134
@@ -153,7 +153,7 @@ other structures, only a few levels are displayed. For example:
153153@group
154154a.b.c.d.e = 1;
155155a
156- @result {} a =
156+ @xresult {} a =
157157
158158 scalar structure containing the fields:
159159
@@ -200,7 +200,7 @@ function argument.
200200@example
201201@group
202202f (rand (2) + rand (2) * I)
203- @result {} ans =
203+ @xresult {} ans =
204204
205205 scalar structure containing the fields:
206206
@@ -223,7 +223,7 @@ indexed like any other variable. For example:
223223[ x.u, x.s(2:3,2:3), x.v ] = svd ([1, 2; 3, 4]);
224224x
225225
226- @result {} x =
226+ @xresult {} x =
227227
228228 scalar structure containing the fields:
229229
@@ -275,7 +275,7 @@ the structure array, you can type its name:
275275@example
276276@group
277277x
278- @result {} x =
278+ @xresult {} x =
279279 @{
280280 1x2 struct array containing the fields:
281281
@@ -292,7 +292,7 @@ two fields:
292292@example
293293@group
294294x(1)
295- @result {} ans =
295+ @xresult {} ans =
296296 @{
297297 a = string1
298298 b = 1
@@ -307,7 +307,7 @@ own field names. For example:
307307@example
308308@group
309309x.a
310- @result {}
310+ @xresult {}
311311 ans = string1
312312 ans = string2
313313@end group
@@ -320,9 +320,9 @@ left-hand side of an assignment:
320320@group
321321[x.a] = deal ("new string1", "new string2");
322322 x(1).a
323- @result {} ans = new string1
323+ @xresult {} ans = new string1
324324 x(2).a
325- @result {} ans = new string2
325+ @xresult {} ans = new string2
326326@end group
327327@end example
328328
@@ -334,7 +334,7 @@ Just as for numerical arrays, it is possible to use vectors as indices
334334x(3:4) = x(1:2);
335335[x([1,3]).a] = deal ("other string1", "other string2");
336336x.a
337- @result {}
337+ @xresult {}
338338 ans = other string1
339339 ans = new string2
340340 ans = other string2
@@ -348,7 +348,7 @@ the example above
348348@example
349349@group
350350size (x)
351- @result {} ans =
351+ @xresult {} ans =
352352
353353 1 4
354354@end group
@@ -362,7 +362,7 @@ example
362362@group
363363in = struct ("call1", @{ x, Inf, "last"@} ,
364364 "call2", @{ x, Inf, "first"@} )
365- @result {} in =
365+ @xresult {} in =
366366 @{
367367 1x3 struct array containing the fields:
368368
@@ -372,7 +372,7 @@ in = struct ("call1", @{x, Inf, "last"@},
372372
373373in(1) = [];
374374in.call1
375- @result {}
375+ @xresult {}
376376 ans = Inf
377377 ans = last
378378@end group
@@ -392,7 +392,7 @@ a = "field2";
392392x.a = 1;
393393x.(a) = 2;
394394x
395- @result {} x =
395+ @xresult {} x =
396396 @{
397397 a = 1
398398 field2 = 2
@@ -410,7 +410,7 @@ a = "long field with spaces (and funny char$)";
410410x.a = 1;
411411x.(a) = 2;
412412x
413- @result {} x =
413+ @xresult {} x =
414414 @{
415415 a = 1
416416 long field with spaces (and funny char$) = 2
@@ -433,7 +433,7 @@ for i = 1:rows (names)
433433 database.(names(i,:)) = ages(i);
434434endfor
435435database
436- @result {} database =
436+ @xresult {} database =
437437 @{
438438 Bill = 37
439439 Mary = 26
@@ -451,7 +451,7 @@ example:
451451@example
452452@group
453453struct ("field1", 1, "field2", 2)
454- @result {} ans =
454+ @xresult {} ans =
455455 @{
456456 field1 = 1
457457 field2 = 2
@@ -468,17 +468,17 @@ structure array with a consistent dimension. For example:
468468s = struct ("field1", @{ 1, "one"@} , "field2", @{ 2, "two"@} ,
469469 "field3", 3);
470470s.field1
471- @result {}
471+ @xresult {}
472472 ans = 1
473473 ans = one
474474
475475s.field2
476- @result {}
476+ @xresult {}
477477 ans = 2
478478 ans = two
479479
480480s.field3
481- @result {}
481+ @xresult {}
482482 ans = 3
483483 ans = 3
484484@end group
@@ -491,7 +491,7 @@ the following example:
491491@example
492492@group
493493struct ("field1", @{@{ 1, "one"@}@} , "field2", 2)
494- @result {} ans =
494+ @xresult {} ans =
495495 @{
496496 field1 =
497497
@@ -598,7 +598,7 @@ can be indexed like this:
598598@example
599599@group
600600c@{ 1@}
601- @result {} ans = a string
601+ @xresult {} ans = a string
602602@end group
603603@end example
604604
@@ -609,8 +609,8 @@ extracted by indexing with a vector of indexes
609609@example
610610@group
611611c@{ 1:2@}
612- @result {} ans = a string
613- @result {} ans =
612+ @xresult {} ans = a string
613+ @xresult {} ans =
614614
615615 0.593993 0.627732
616616 0.377037 0.033643
@@ -624,7 +624,7 @@ third place of the previously created cell array
624624@example
625625@group
626626c@{ 3@} = 3
627- @result {} c =
627+ @xresult {} c =
628628
629629 @{
630630 [1,1] = a string
@@ -653,10 +653,10 @@ function. For example:
653653@example
654654@group
655655iscell (c)
656- @result {} ans = 1
656+ @xresult {} ans = 1
657657
658658iscell (3)
659- @result {} ans = 0
659+ @xresult {} ans = 0
660660
661661@end group
662662@end example
@@ -679,7 +679,7 @@ a 2-by-2 cell array containing empty matrices
679679@example
680680@group
681681c = cell (2,2)
682- @result {} c =
682+ @xresult {} c =
683683
684684 @{
685685 [1,1] = [](0x0)
@@ -702,7 +702,7 @@ of the first one is displayed
702702c1 = cell (3, 4, 5);
703703c2 = cell ( [3, 4, 5] );
704704size (c1)
705- @result {} ans =
705+ @xresult {} ans =
706706 3 4 5
707707@end group
708708@end example
@@ -738,10 +738,10 @@ following example illustrates the difference:
738738@group
739739c = @{ "1", "2", "3"; "x", "y", "z"; "4", "5", "6"@} ;
740740c@{ 2,3@}
741- @result {} ans = z
741+ @xresult {} ans = z
742742
743743c(2,3)
744- @result {} ans =
744+ @xresult {} ans =
745745 @{
746746 [1,1] = z
747747 @}
@@ -760,7 +760,7 @@ with the following command:
760760@example
761761@group
762762c(:, [1, 3]) = @{ 0@}
763- @result {} =
763+ @xresult {} =
764764 @{
765765 [1,1] = 0
766766 [2,1] = 0
@@ -792,7 +792,7 @@ following command:
792792@group
793793c = @{ 1, 2, 3; 4, 5, 6@} ;
794794c([1, 2], :) = c([2, 1], :)
795- @result {} =
795+ @xresult {} =
796796 @{
797797 [1,1] = 4
798798 [2,1] = 1
@@ -813,7 +813,7 @@ example can be swapped back like this:
813813@example
814814@group
815815[c@{ [1,2], :@} ] = deal (c@{ [2, 1], :@} )
816- @result {} =
816+ @xresult {} =
817817 @{
818818 [1,1] = 1
819819 [2,1] = 4
@@ -832,7 +832,7 @@ can be used to delete elements from a cell array:
832832@group
833833x = @{ "1", "2"; "3", "4"@} ;
834834x(1, :) = []
835- @result {} x =
835+ @xresult {} x =
836836 @{
837837 [1,1] = 3
838838 [1,2] = 4
@@ -847,7 +847,7 @@ array elements but not delete the space for them:
847847@group
848848x = @{ "1", "2"; "3", "4"@} ;
849849x(1, :) = @{ []@}
850- @result {} x =
850+ @xresult {} x =
851851 @{
852852 [1,1] = [](0x0)
853853 [2,1] = 3
@@ -883,7 +883,7 @@ converts a character array to a cell array of strings:
883883@group
884884a = ["hello"; "world"];
885885c = cellstr (a)
886- @result {} c =
886+ @xresult {} c =
887887 @{
888888 [1,1] = hello
889889 [2,1] = world
@@ -905,7 +905,7 @@ argument:
905905@group
906906c = @{ "hello", "world"@} ;
907907strcmp ("hello", c)
908- @result {} ans =
908+ @xresult {} ans =
909909 1 0
910910@end group
911911@end example
@@ -1011,7 +1011,7 @@ of a cell array can be extracted into a comma-separated list with the
10111011@group
10121012a = @{ 1, [2, 3], 4, 5, 6@} ;
10131013b = [a@{ 1:4@} ]
1014- @result {} b =
1014+ @xresult {} b =
10151015 1 2 3 4 5
10161016@end group
10171017@end example
@@ -1025,7 +1025,7 @@ following example illustrates:
10251025@group
10261026a = @{ 1, rand(2, 2), "three"@} ;
10271027b = @{ a@{ [1, 3] @} @}
1028- @result {} b =
1028+ @xresult {} b =
10291029 @{
10301030 [1,1] = 1
10311031 [1,2] = three
@@ -1061,7 +1061,7 @@ in@{4@} = "first";
10611061out = cell (4, 1);
10621062[out@{ 1:3@} ] = in@{ 1 : 3@} ;
10631063[out@{ 4:6@} ] = in@{ [1, 2, 4]@} )
1064- @result {} out =
1064+ @xresult {} out =
10651065 @{
10661066 [1,1] =
10671067
0 commit comments