Plotting complex functions using the Symbolic Math Toolbox? - math

How should I plot this function:
z^(1/n) [complex roots of z]
with ezsurf(), ezmesh(), ...? In the official documentation is clearly stated that ezsurf() and ezsurfc() for example, do not accept complex inputs.
I understand the trick is probably in using both real() and imag() functions, but even so, I can't get rid of the problem.

The basic idea seems to work for me alright. Of course you can go on to tweak the axis limits, grid spacing, color look-up table, etc.. The online documentation at http://www.mathworks.com/help/techdoc/ref/ezsurf.html has some nice examples that aren't found in the built-in help system. Good luck!
syms z n
subplot(2,1,1)
ezsurf(real(z^(1/n)))
subplot(2,1,2)
ezsurf(imag(z^(1/n)))

Related

Julia and Bessel functions

I am interested in Julia and would like to understand a couple of things before I dive into it. I would like to have a look at a working code which calculates this expression.
In that expression everything is a constant but for the Bessel functions, of course. The number n is an integer and "e" is an eccentricity (ranging from 0. to, say, 0.999).
For a given value of n I would like to derive hc,n. E.g. if n=2, then hc,2.
No, I am not tricking you into coding for me.
I am used to working with shell scripts, bc, and plot with gnuplot. I would like to have something more flexible than all of this and this one would be a good example to start looking at julia. Thanks!
For the best tutorial on doing equations/mathematics in Julia have a look at https://github.com/mossr/BeautifulAlgorithms.jl
This will give you an excellent overview along with the initial feelling of the language.

2D Raycasting/Checking if 2 line segments intersect

How would I make a 2D raycast? Also, how would I check if 2 line segments intersect (relativity the same thing in my eyes, probably different though). I am not using unity or anything, I am just using plain python (I can translate from most languages to python so I don't really care what language you use) and don't want to use a library so I can learn. But every article I look at has no actual explanation, it just shows code. I've looked at the Geeks4Geeks one and that also really only shows code and does not explain what it does. So if someone could explain it that would be helpful.

p adjustment method using dunnettTest (PMCMRplus)

I have a major problem: I am an absolute beginner in R programming :) using libaray PMCMRplus I want to perform a dunnetTest. However, I cant change the methods to adjust the p value. Whatever command I've used I will allways get a single-stept adjustment. Can please anyone help me?? The commant I am using is:
dunnettTest(v~Gruppe, alternative="greater", p.adjust.methods ="BH")
Maybe a little bit late but three inputs to your question that may help:
1.) For v~Gruppe have you specified what content should be used? You can define this by using $ such as v~Gruppe$columnofyourdataframe
2.) Also for v~Gruppe: according to the PMCMRplus documentation you have to use dunnettTest(x, g). You use v instead of x and did not define g.
3.) For alternative="greater" have you tried to further specify by using alternative = c("two.sided", "greater", "less")? This is also explained in the PMCMRplus documentation.

ASCII equivalent to \eqn{\bar{x}} in Rd files

I am writing the documentation for a function of an R package I am building.
In order to have a moderately nice aspect for the help file, I need the equivalent of \bar{x} in ASCII:
\eqn{\bar{x}}{ASCII equivalent}
Not sure there's a consensus on the best way to do this, it's more a matter of taste and clarity.
Having faced this issue myself, two solutions I have used are:
y = \eqn{\bar{x}}{xbar}
y = \eqn{\bar{x}}{mean(x)}
The advantage of the latter is that when the help is displayed as ASCII, the user can copy/paste (send) the text to an R process, getting an example value for y. This assumes that \bar{x} is shorthand for the mean, as is often the case.

Mathematica not evaluating any trigonometric integrals

When I input any integral, say sin[x] or ln[x], all I get back is the input. And from what I understand that usually means that mathematica can't evaluate the integral...What am i missing here?
I'm new to stackoverflow so I can't post screenshots.
Read the documentation:
Sin[x] manual
Log[x] manual
Note also that by default Log function is of base e, therefore it is your Ln.
In addition, if you have further questions mathematica/wolfram has it's own subsite where you should ask related questions https://mathematica.stackexchange.com/
As of version 9 you can query wolfram alpha directly and it can even try to interpret human language (and fix syntax mistakes like this). To query wolfram alpha start line with =.

Resources