Community Profile

photo

Bjorn Gustavsson


Last seen: Today

UIT, the Arctic University of Norway

1,029 total contributions since 2001

Contact

Bjorn Gustavsson's Badges

  • Revival Level 2
  • 24 Month Streak
  • First Submission
  • Explorer
  • 5-Star Galaxy Level 5
  • Knowledgeable Level 4
  • Personal Best Downloads Level 2
  • Pro
  • Editor's Pick
  • First Review
  • Thankful Level 1
  • First Answer
  • Solver

View details...

Contributions in
View by

Answered
How to find total derivative by using total derivative operator?
If you have the symbolic toolbox it is just to get to work: syms x y t syms u(x,y,t) syms p(x,y,t) dudx = diff(u*p,x) % etc....

6 hours ago | 0

Answered
How to fit a multi modal distribution using a weighted sum of PDFs?
You don't have enough samples to confidently claim you have a multimodal distribution. If you simply try this with fitting expon...

6 hours ago | 0

| accepted

Answered
Entropy values of all the bands in a given hyperspectral image.
It seems it is not the most robust functionality, If I run the test of entropy from the help of the entropy-function I get rathe...

1 day ago | 0

| accepted

Answered
How to solve a non linear ovedetermined system of equations??
You can always try with regular minimization. Perhaps something like this: function err = err_1(pars,x,y,z,y) c = 3; % guess, ...

2 days ago | 0

| accepted

Answered
Error: Array indices must be positive integers or logical values.
Matlab has the convention that arrays-indexes starts from 1. Arrays have to be indexed with integers. You can solve your proble...

2 days ago | 0

Answered
How to do exponential curve fitting like y=a.* log(x + b.*exp(c.*x)
You can do something like this: mod_fcn = @(b,x) b(1).*(log(x + (b(2).*exp(b(3).*x)))); % Objective Function err_fcn = @(b...

3 days ago | 0

| accepted

Answered
How to do this with Delaunay Triangulation?
You'll have to go through DT.ConnectivityList and remove the triangles you don't like. The function returns a convex set of tria...

4 days ago | 0

Answered
unable to solve non linear differential equation
This looks like an equation of the form: Unless you have an equation for a trajectory of a spinning object falling in gravity...

4 days ago | 0

Answered
Solving system of ODEs with ode45 and multiple time dependent variables
In your ODE-fun you can "simply" interpolate your time-dependent coefficients. Something like this: function dTdt = ODEfun(t,T,...

5 days ago | 1

| accepted

Answered
How to make a matrix of all zeros be the same size as a data set being used?
Something like this: u = zeros(size(v)); HTH

5 days ago | 1

| accepted

Answered
Constrained optimization, free code
There ought to be some optimization-tools on the file-exchange that can be used instead of fminsearch. Perhaps the minimize tool...

5 days ago | 0

Answered
2D DFT of an image
OK, here's a solution that's computationally useless since 1965: szIm = size(Im); M1 = dftmtx(szIm(1)); M2 = dftmtx(szIm(2));...

5 days ago | 0

Answered
Why is Matlab changing thickness of the line in this plot ?
input4 and input5 have circle and triangle set as marker. I can't see where that happens, but try to un-set that. Something like...

5 days ago | 0

| accepted

Answered
Eigen Vectors and Values using Matlab
Why not calculating the eigenvectors at once? [Ev,lambda]=eig(A) Also, when rounding the eigenvalues, you're no longer guarant...

5 days ago | 1

Answered
Diagonal Interpolation/Extrapolation of a 1024 x 30 Matrix
What you can try for this is to align the main peaks, using something like this: [~,idxPeaks] = max(I_spectras,[],2); % Here I ...

6 days ago | 0

Answered
Converting Linear Equations to Matrix Form
Is k some sort of propagation (time? space?) index and you want to convert these equations into a matrix-format, or are these ac...

6 days ago | 0

Answered
Save multiple image automatically
You simply have to generate a sequence of unique filenames to save to. Something like this: outfile = fullfile(outfolder, s...

6 days ago | 0

| accepted

Answered
Cell to mat conversion
If you want to extract the content of one cell simply do: b = a{1}; If you want to merge a couple of cells into an array or ma...

6 days ago | 0

| accepted

Answered
interp2 error non monotonus
It should (big claim, I know) be as simple as: torque = data(2:end,1); rpm = data(1,2:end); eff_epk = data(2:end,2:end); Nm ...

8 days ago | 2

| accepted

Answered
How to make subplots scroll at the same time?
See the help and documentation for linkaxes (and possibly linkprop). I'd do something like this: %Create subplot sph1 = subplo...

8 days ago | 0

| accepted

Answered
how to vectorise or speed up the specific code
Newton says you can cut it in two if you take into account that the force from particle i on particle j is equal but directed in...

11 days ago | 2

Answered
Why `sparse` function accumulate large sparse COO format matrix by index so fast?
Because sparse is a built-in function that Mathworks most likely have spent many man-months (we wouldn't know) on optimizing. Yo...

11 days ago | 0

Answered
How to create null vector Matlab
First off if you've done something like: N = 12; M = 14; K = 7; Mtr = randn(M,N); V = rand(1,K); V=zeros(1,length(N)-lengt...

12 days ago | 0

| accepted

Answered
i need to save images with different file names in seperate folders
You can do this, as Jan hinted at, something like this: faces = 1:6 face_names = {'top','bottom','front','back','left','right'...

14 days ago | 1

Answered
how to make a covarinace matrix using data from excel?
Just use cov. From the help of the cov-function: cov Covariance matrix. cov(X), if X is a vector, returns the variance. F...

14 days ago | 0

Answered
How to make ticks labels (the numbers, not the axis labels.) bold when using latex interpreter.
This seems to work in general: set(gca,'fontweigth','bold') HTH

14 days ago | 0

Answered
Average intensity as a function of angle in 2D FFT plot
This is kind-of-difficult in practice. Your fft has low-wavenumber components at [0,0], [1,0], [-1, 0], [0,1], [0,-1] and if we ...

15 days ago | 1

Answered
for loop with vectors having different sizes
To fool-proof your concatenation, and to generate better directory-names you could do something like this: a = [1 2]; b = [3 4...

18 days ago | 0

Answered
Instantaneous Velocity from Displacement and Time values
There are busloads of things you could try: interpolate to a denser time-grid (using 'phcip' or 'spline' for interpolation metho...

18 days ago | 0

Load more