Questions tagged [matlab]

Questions about the numerical programming language MATLAB.

611 questions
52 views

How to find the roots for this equation

I am new using Matlab. I am trying to find the roots for an effective permittivity equation in two forms: Quadratic and Nonlinear and it Should have the same solution. Any suggestion on how to solve ...
60 views

Graphing electric potential of a ring of charge using MATLAB help

Here is a summary of what I am trying to do: Use MATLAB to compute the potential $V$ at any point $(x, y, z)$ in space due to a uniform ring of charge. Use a Riemann sum to compute the integral with ...
23 views

Execution time of cumulative integral

In Matlab, we have the cumtrapz function, which returns the approximate cumulative integral of y: I = cumtrapz(x,y) This ...
40 views

Computing Trajectory Equations of Kerr Geodesics

I want to numerically solve the trajectory equations of a Kerr geodesic given by wikipedia in Matlab. The trajectories look like: I implemented the equations and solved it with the standard Runge-...
34 views

How to do Weierstrass-transform in MATLAB?

I have a diagonalization problem. I have the eigenstates correctly, and I want to do a Gaussian-smearing (Weierstrass-transform) on them. So I have the wave functions ($\Psi$), and the continuous ...
21 views

Simulating Anderson model, have problem with momentum representation (MATLAB)

I want to change from real-space representation to momentum-space representation I have a Hamilton-operator (Anderson-model), and I calculated some kind of entropy of its eigenstates (this is working, ...
25 views

Fit exponential convergence

I'm working with a numerical algorithm whose output $y$ asymptotically approaches a certain unknown value $a$. I expect an exponential convergence, i.e. the data $y$ given by my algorithm should be ...
38 views

Monte Carlo - Random Walk Simulation - polyfit the log log data points?

This is part of the code in matlab for a random-walk simulation. To test the code, I'm using steps=; there will be more values, but I want to run it for 1 trial to decrease code processing. <...
318 views

54 views

Online Parameter Estimation using steepest descent

I have a first order system which is described by the following differential equation: dx/dt = -a*x + b*u where u is the input <...
31 views

Plotting ratings matrix

Hello fellows and folks. I have been looking to do this for 1 month and still cannot find the way to do it. Here’s what’s going on: I have a csv file called ratings.csv with the following ...
114 views

Use SLEPc from Matlab

Is there a direct way to use SLEPc from Matlab? I remember that in some old manuals there was some Matlab interface. However, in the last one, I cannot find any reference to this. For me, it would be ...
206 views

Potential gain - Matlab vs C/C++ - assembly and eigenvalues

I have a Matlab code computing the solution to an eigenvalue PDE. It consists of two parts: assembly of the stiffness/rigidity matrices and solving a generalized eigenvalue problem. I mention that the ...
140 views

51 views

How to find two points within defined region in this constrained optimization problem?

I am doing a project related to robotics where I am using fmincon function from matlab to minimize the distance between the points ...