mupad

Use more “natural” form to manipulate piecewise step functions in Matlab MuPAD?

我怕爱的太早我们不能终老 提交于 2019-12-24 14:53:14
问题 I have the unit step function: u0:= piecewise([-infinity < t and t < 0,0],[0 < t and t < infinity,1]): Now I want to plot it at some point: T:=1:; plot(u0|t=t-T/2); This works. But when I use a more natural expression: T:=1:; plot(u0(t-T/2)); it simply plots the original unshifted step function. Is there any way to use the more simpler form when plotting the modified step function? 回答1: I believe the reason that what you call the "more natural form" doesn't work, is because u0 has not been

Using the Pochhammer Symbol in Matlab

旧时模样 提交于 2019-12-22 11:06:31
问题 I've tried to use a script that evaluates the Pochhammer symbol (rising factorial) in Matlab, but it fails to evaluate pochhammer(x,n) whenever x is a negative number even though the expression is valid when x is negative (Wolfram Alpha and Mathematica give answers for Pochhammer(-3,2) ). Can anyone help me get pochhammer working in Matlab for negative arguments? 回答1: I assume that you're referring to this Pochhammer function. Note that pochhammer (not capitalized) is part of MuPAD, which is

Printing syms / matlabFunction slow

给你一囗甜甜゛ 提交于 2019-12-19 19:56:49
问题 I am having a lot of trouble trying to make symbolic substitution go faster - that is, substituting in for variables in a symbolic expression and getting out a double. I am creating a complicated function f, and calculating its jacobian df. This goes at a reasonable pace, and I can save it to a file just fine. But when I try to use matlabFunction or even disp or fprintf, the system hangs and is unable to proceed further (even when matlabFunction is set to unoptimized). This is a major problem

Matlab: linear congruence solver that supports a non-prime modulus?

孤人 提交于 2019-12-12 12:33:21
问题 I'm working on some Matlab code to perform something called the Index Calculus attack on a given cryptosystem (this involves calculating discrete log values), and I've gotten it all done except for one small thing. I cant figure out (in Matlab) how to solve a linear system of congruences mod p, where p is not prime. Also, this system has more than one variable, so, unless I'm missing something, the Chinese remainder theorem wont work. I asked a question on the mathematics stackexchange with

Error using mupadmex, Error in sym/symsum (Evaluate a definite integral)

▼魔方 西西 提交于 2019-12-12 02:25:22
问题 I am trying to evaluate a definite integral using the following code : m=4; t=4; n=5; P=10; reset(symengine) syms x; syms k; mean=int(log(1+P*x/t)*symsum( factorial(k)*x^(n-m)*exp(-x)/factorial(k+n-m)*feval(symengine,'laguerreL',n-m,k,x)*feval(symengine,'laguerreL',n-m,k,x),k,[0,m-1]) ,x,0,inf) But it gives the following error: Error using mupadmex Error in MuPAD command: The number of arguments is incorrect. [has] Evaluating: sum Error in sym/symsum (line 114) rSym = mupadmex('symobj::map'

Define general relative search path for custom Mupad procedures

吃可爱长大的小学妹 提交于 2019-12-10 19:13:19
问题 Imagine I have a mupad-notebook myMupadNotebook.mn at the path 'C:\projectFolder\ABC\abc\' . It calls the procedure MyMupadProcedure.mu which is located at 'C:\DEF\GHI\' . Now I have a Matlab script main.m at 'C:\projectFolder\XYZ\xyz\' with the content: nb = mupad('C:\projectFolder\ABC\abc\myMupadNotebook.mn'); status = evaluateMuPADNotebook(nb); So it initializes a symbolic engine and executes the Mupad script. But the Mupad script requires to know where to find the procedure. So I can

Using the Pochhammer Symbol in Matlab

﹥>﹥吖頭↗ 提交于 2019-12-05 21:37:07
This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I've tried to use a script that evaluates the Pochhammer symbol (rising factorial) in Matlab, but it fails to evaluate pochhammer(x,n) whenever x is a negative number even though the expression is valid when x is negative (Wolfram Alpha and Mathematica give answers for Pochhammer(-3,2) ). Can anyone help me get pochhammer working in Matlab for negative arguments? I assume that you're referring to this Pochhammer function . Note that pochhammer (not

mtaylor MuPAD - Matlab

允我心安 提交于 2019-12-02 06:33:21
问题 I am trying to run the function mtaylor from the MuPAD engine in MatLab, which provides a multivariate Taylor expansion of a function. However, it keeps telling me I am trying to expand around an invalid point. Here is a minimal working example of what I tried: syms x y; feval(symengine,'mtaylor',exp(x^2 - y), [x, y], 4) Error message: vError using mupadengine/feval (line 157) MuPAD error: Error: Invalid expansion point. [mtaylor] Why doesn't this work? 回答1: The reason this works with MuPAD's

mtaylor MuPAD - Matlab

做~自己de王妃 提交于 2019-12-02 03:41:54
I am trying to run the function mtaylor from the MuPAD engine in MatLab, which provides a multivariate Taylor expansion of a function. However, it keeps telling me I am trying to expand around an invalid point. Here is a minimal working example of what I tried: syms x y; feval(symengine,'mtaylor',exp(x^2 - y), [x, y], 4) Error message: vError using mupadengine/feval (line 157) MuPAD error: Error: Invalid expansion point. [mtaylor] Why doesn't this work? The reason this works with MuPAD's mtaylor syms x y; feval(symengine,'mtaylor',exp(x^2 - y), x, 4) % [x] is fine too and this doesn't syms x y

Printing syms / matlabFunction slow

送分小仙女□ 提交于 2019-12-01 17:45:11
I am having a lot of trouble trying to make symbolic substitution go faster - that is, substituting in for variables in a symbolic expression and getting out a double. I am creating a complicated function f, and calculating its jacobian df. This goes at a reasonable pace, and I can save it to a file just fine. But when I try to use matlabFunction or even disp or fprintf, the system hangs and is unable to proceed further (even when matlabFunction is set to unoptimized). This is a major problem as I need to be able to do reasonably fast substitution. The f vector is 24 elements, and the Jacobian