Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,546 Was thanked: 1307 time(s) in 766 post(s)
|
Originally Posted by: Jean Giraud Maple does not like subsrcipt. That by clicking it shows the brackets, to me it is a bug that it does not output the right result. I accept the subscript as a local tutorial demo. For real work and particularly for publishing: NO subscript.
Don't worry about subscripts. For the variables subscripts supported as was described here. If Maple Wrapper meet a variable with the dot (comma) in its name this name will wrapped with the symbol `. You can see this in log file (<plugin folder>\mvr5\mvr5.txt). The log for int(x.1,x.1): Code:03.03.2016 9:20:29 [->] smath_int(`x.1`,`x.1`)
03.03.2016 9:20:29 [->] C:\Temp\tmpAC26.tmp:
interface(quiet=true);
with(linalg):with(inttrans):with(plots):
writeto("C:\\Temp\\tmpAC27.tmp"):
smath_line := proc() local i: for i from 1 to nargs - 2 do args[i]; od: end:
smath_sum := proc() if nargs = 1 then sum( args[1] ); elif nargs = 2 then sum( args[1], args[2] ); elif nargs = 4 then sum( args[1], args[2] = args[3] .. args[4] ); fi: end:
smath_product:= proc() if nargs = 1 then product( args[1] ); elif nargs = 2 then product( args[1], args[2] ); elif nargs = 4 then product( args[1], args[2] = args[3] .. args[4] ); fi: end:
smath_int := proc() if nargs = 2 then int( args[1], args[2] ); elif nargs = 4 then int( args[1], args[2] = args[3] .. args[4] ); fi: end:
smath_diff := proc() if nargs = 2 then diff( args[1], args[2] ); elif nargs = 3 then diff( args[1], args[2] $ args[3] ); fi: end:
smath_sys := proc() { args[i] $ i = 1 .. nargs - 2 }; end:
smath_el := proc() args[1][ args[2] ]; end:
smath_mat := proc()
local i, j, out:
out := [ args[j] $ j = 1 .. args[ nargs ] ]:
for i from 2 to args[ nargs - 1 ] do
out := out, [ args[j] $ j = ( i - 1 ) * args[ nargs ] + 1 .. ( i - 1 ) * args[ nargs ] + args[ nargs ] ]:
od:
convert( [ out ], array );
end:
smath_submatrix := proc() submatrix( args[1], args[2] .. args[3], args[4] .. args[5] ); end:
ans := \
smath_int(`x.1`,`x.1`):
if ( whattype( ans ) = `exprseq` ) then
convert( convert( cat( `mat(`, substring( convert( [ans], string ), 2..-2 ), `,`, nops( [ans] ), `,1)` ), string ), symbol );
elif ( whattype( ans ) = `set` ) then
convert( convert( cat(`mat(`,substring(convert(map2(op,2,[ans[i]$i=1..nops(ans)]),string),2..-2),`,`,nops(ans),`,1)`), string ), symbol );
elif ( whattype( ans ) = `symbol` ) then
convert( convert( eval( ans ), string ), symbol );
elif ( whattype( ans ) = `series` ) then
convert( convert( ans, polynom) , symbol );
elif ( whattype( ans ) = `string` ) then
convert( ans, symbol );
else
convert( convert( ans, string ), symbol ); fi;
quit:
03.03.2016 9:20:29 [<-] C:\Temp\tmpAC27.tmp:
1/2*`x.1`^2
03.03.2016 9:20:29 [<-] 1/2*x.1^2
|
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|