3
votes
3answers
73 views

Changing [2,4] into [0,1,0,0,0,1] in Matlab

Good day, I apologize for the very vague title, I didn't really know how to formulate what I want. However, I can explain what I mean: I have a vector v1: ...
0
votes
1answer
96 views

How to write a function that operates elementwise on a matrix?

I have written a function $f$ in Matlab that receives a number and returns a number, for example function r = myFun(x) r = (exp(x)+3)/2 end I would now like ...
0
votes
3answers
99 views

Calculate the number of times an angle must be repeated for it to complete a full rotation and for it to close

I'm trying to calculate the number of times an angle must be repeated to make a full rotation and become closed. Example: The internal angle of a pentagon is 108 degrees and it must repeat 5 times to ...
3
votes
1answer
287 views

Switching from Mathematica to MATLAB: As a text editor?

I have been using Mathematica for almost a year, and the most indispensable feature in Mathematica to me has been the ability to write really nice documents and print them into PDF or TEX files. In ...
0
votes
1answer
133 views

matlab equal does not work

How to judge whether two whatever is equal? alphat and alpha are two kind big vectors. Why it turns 0, which means they are not equal?
1
vote
1answer
218 views

Logarithmic scale in MuPAD

I had to plot a function, $e_n=\ln(n!)-n\ln(n)+n$, relative to a logarithmic scale. In MATLAB, I could do it simply by using semilogx but in MuPAD I can't find such ...
0
votes
1answer
2k views

Finding matrix inverse by Gaussian Elimination With Partial Pivoting

Hello guys I am writing program to compute determinant(this part i already did) and Inverse matrix with GEPP. Here problem arises since i have completely no idea how to inverse Matrix using GEPP, i ...
1
vote
1answer
434 views

How to plot multinomial beta from Dirichlet Distribution

I would like to plot the multinomial beta from the Dirichlet Distribution wiki page. $$\mathrm{B}(\alpha) = \frac{\prod_{i=1}^K \Gamma(\alpha_i)}{\Gamma\bigl(\sum_{i=1}^K ...
0
votes
0answers
36 views

MATLAB plotting issue

I posted this question on StackOverflow, but did not get any answers, so hopefully this will work better. Is anyone familiar with plotting in the Matlab SISOtool? For some reason, I cannot access the ...
0
votes
1answer
213 views

Matlab: How to Exclude Zero from Domain?

I want to plot the wireframe surface of $f(x,y)=\frac{x^2-y^2}{x^2+y^2}$ in Matlab. The code I typed is as follows. x=-0.1:.001:0.1; y=-0.1:.001:0.1; [X,Y]= meshgrid(x,y); ...
-1
votes
1answer
139 views

Remainder theorem and computation in mat lab

Respected Mathematicians, Suppose we are given 10 remainders each of 10 digits for given ten distinct prime bases each of 10 digits. Find the rational number that corresponds to these remainders in ...
2
votes
1answer
394 views

MATLAB Fermi-Pasta-Ulam lattice model can't force periodic boundary condition

I am building MATLAB code to implement a symplectic integrator using a second order split-step method for the Fermi-Pasta-Ulam problem. The Hamiltonian is in the form: H = sum from i=1 to N ...
22
votes
1answer
7k views

Is Sage on the same level as Mathematica or Matlab for graph theory and graph visualization?

The context: I'm going to start working on a project that involves running predefined algorithms (and defining my own) for very big graphs (thousands of nodes). Visualization would also be welcome if ...
0
votes
1answer
322 views

How to plot graph y=1/x or y=x^2

I am using Octave but I think it applies to MatLab too, so I'm tagging this MatLab since there isnt a Octave tag When I do x=linspace(-5,5,25) y=1/x I get ...
1
vote
1answer
551 views

Does MATLAB take care of sparsity itself?

Suppose i have matrix of size 1000*1000 with 70% sparsity. I am performing some multiplication, inverse operations upon it. While making calculations, does MATLAB make checks to see if matrix is ...
0
votes
1answer
956 views

In this Cholesky Algorithm in matlab, what is the abs function doing

We have been told in our homework to implement the following program: function A = Cholesky(A) % Cholesky Decomposition of a Matrix A, so that the resulting matrix L gives A=L*L N = size(A,1); ...
3
votes
2answers
9k views

Implement a program in Matlab for LU decomposition with pivoting

I need to write a program to solve matrix equations Ax=b where A is an nxn matrix, and b is a vector with n entries using LU decomposition. Unfortunately I'm not allowed to use any prewritten codes in ...
1
vote
1answer
251 views

Matlab: Website with a lot of functions to download

I am looking for a website that contains a collection of functions, more than Matlab contains, to download I use from Matlab. The extension should be *.m or the code should appear. Thank you!
1
vote
1answer
6k views

Find equation of curve fit programmatically in Matlab?

In MATLAB, when you plot something, there's a tool available which is called "curve fitting". And if you have a set of data points and a linear correlation, this tool will easily come up with an ...
3
votes
1answer
1k views

Numerically Solving a Second Order Nonlinear ODE

Okay, I have this not so pretty 2nd order non-linear ODE I should be able to solve numerically. $$f''(R) + \frac{2}{R} f'(R)=\frac{0.7}{R} \left( \frac{1}{\sqrt{f(R)}} - \frac{0.3}{\sqrt{1-f(R)}} ...
0
votes
3answers
679 views

Finding positive integer solutions to functions with only positive integer input

For the equation $f(x,y) = x^2/y$ given that $x$ and $y$ are integers What is the easiest/fastest way to find at least one tuple $(x_0,y_0)$ solution to $f(x,y)=4$ or any other number really. I ...
60
votes
10answers
40k views

What should I learn first, Mathematica or MatLab?

I have a non-professional interest in math and I would like to be able to be curious and play around with some math that I'm learning about (both here and from calculus-and-higher level math classes). ...