Community Profile

photo

Bjorn Gustavsson


Last seen: Today

UIT, the Arctic University of Norway

344 total contributions since 2015

Contact

Bjorn Gustavsson's Badges

  • Explorer
  • 12 Month Streak
  • Knowledgeable Level 4
  • Pro
  • First Review
  • Revival Level 1
  • First Answer

View details...

Contributions in
View by

Answered
How to subtract the elements in one matrix with the corresponding elements in another matrix?
You're not asking for values to subtract, but indices to not include. My simple suggestion is that you take a look at the randpe...

3 días ago | 0

Answered
Solve a second-order differential equation with an array parameter that does not depend explicitly on the independent variable
Your problem is that ode45 will evaluate odeFun at arbitrary points in time (as seen from your perspective at least). That means...

4 días ago | 1

| accepted

Answered
Initial values for ode45 solver
If bvp4/5c doesn't handle this type of problems then this sounds like a setup for using the shooting method. Simply build a func...

4 días ago | 1

| accepted

Answered
Integrating with a static starting value and changing end value
Either you'll have to simply loop: Cp= @(T) 0.132+1.56e-4.*T+2.64e-7.*T.^2; dT=linspace(0,300); T0=-100; for i_T = numel(dT)...

4 días ago | 0

| accepted

Answered
Differentiation and integration of functions
You need to change from assignment to equality: x=dsolve('Dx==(11*x+1)/sqrt(x^2+22)','x(0)=0') But this is most likely not th...

5 días ago | 0

Answered
conversion to one line function
You can build an one-line anonymous function like this: oneliner = @(t) 3.*double(-1 <= t & t<1) + (-5.*t+12).*double(1<= t & t...

6 días ago | 0

| accepted

Answered
display my generated matrix
You can always use imagesc to display the matrix as a pseudo-coloured image: imagesc(dist),colorbar There are plenty other 2-D...

11 días ago | 0

Answered
Motion blur of a colored image
This is easiest to do color-plane by color-plane: rgbMB(:,:,3) = conv2(rgbIM(:,:,3),K,'same'); rgbMB(:,:,2) = conv2(rgbIM(:,:,...

12 días ago | 1

| accepted

Answered
how to get MTF from PSF
The MTF is simply the absolute of the Fourier-transform of the PSF. That is: MTF = abs(fftshift(fft2(psf))); Just a couple o...

12 días ago | 0

Answered
Cant Solve ODE with dsolve
So you have a linear first-order differential equation looking something like this: Then I'd suggest that special cases are ...

12 días ago | 1

| accepted

Answered
How to implement Discrete Integration of the Gaussian Function on a Grid?
In that case you better integrate your Gaussian (point-spread-function?) over the pixel-areas. You could use something like this...

13 días ago | 1

| accepted

Answered
Modulation Transfer function: From edge spread function to MTF
I've seen definitions of the MTF as the magnitude ot the Fourier-transform of the line-spread-function or the magnitude of the F...

13 días ago | 0

Answered
How to regrid data based on longitude-latitude variables?
First of all, your time-variable contains integers between 1411296 and 1463136, when you try to use those as indices you're look...

14 días ago | 0

Answered
Conduct STFT analysis for chirp signal for 25% overlapping
From the help for spectrogram: S = spectrogram(X,WINDOW,NOVERLAP) NOVERLAP is the number of samples each segment of X ...

14 días ago | 0

Answered
How to solve coupled non linear ode using ode 45
When you have a coupled set of ODEs the ode-function has to return a column-vector with the derivatives. So you'll have to modif...

16 días ago | 0

| accepted

Answered
Why this error? 'Transpose on ND array is not defined. Use PERMUTE instead.'
Because transpose is only defined for 2-D arrays. For a 3-D (or larger dimensions) it is not unambiguous which dimensions you wa...

18 días ago | 0

Answered
solving PDE problem : Linear Advection diffusion equation problem
When you work with problems like this you have to make sure that your matrices end up the sizes you expect them to be. To do tha...

18 días ago | 0

Answered
Empirical source terms with PDEPE
To the best of my understanding you should be able to define your pde-function something like this: function [c,f,s] = pde_inte...

19 días ago | 0

Answered
how to plot a function consisting of sum of dirac deltas?
Have a look at stem, it does somewhat "representing Dirac'ses", maybe it is good enough? HTH

20 días ago | 1

Answered
Non-constant statistical weights in non-linear regression
When I have this type of problems (fitting of functions to photon-counting-data where the weights should be calculated from the ...

20 días ago | 0

Answered
Integration of a function that is built by a loop
You should do two things! 1, write that function definition into a function, then integrate it from 0 to pi. Use the integral o...

20 días ago | 0

| accepted

Answered
How do I convert my matrix of 5799 x 1 double into 1933 rows of 3 x 1 cells?
Have a look at the repmat function. HTH

20 días ago | 0

Answered
How to speed up making large matrices, and reduce memory usage
This looks like a very sparse matrix, right? Then I would first figure out how to assign the blocks of Aineq from its components...

20 días ago | 1

| accepted

Answered
Using ODE45 to solve a system of 2nd order ODEs equation
After fixing the sign-errors in your ODE-function this: thetathetadot0 = [0 0 0 -1]; [t,theta] = ode45(@(t,y) pendulum(t,y),0:...

20 días ago | 0

| accepted

Answered
Conversion to double from struct is not possible.
This is obviously an operation that's not supported. If you look at the contens of one struct, you might find that the Jointname...

21 días ago | 0

Answered
Cross-validation the output of "scatteredInterpolant" in order to choose best method (linear, nearest, and natural)
To me that sound somewhat sensible, but would primarily check the regular-grid interpolation-method, and not the scatteredInterp...

21 días ago | 1

| accepted

Answered
How to create a scatter plot with three variables?
you should use scatter, something like this: psz = 23; scatter(x,y,psz,z,'filled') That should give you something to start wi...

21 días ago | 0

| accepted

Answered
How do I do Pyramid plot
Surely this is a homework task? Regardless, after you've figured out loops and conditional statements, you should start to thin...

22 días ago | 1

Answered
solution to non homogenous time dependent differetial equation using ODE45
You can convert a second order ODE to two coupled first order ODEs: can be split up into 2 by introducing a second variable, ...

23 días ago | 0

| accepted

Answered
The dimension of the input vector in the imagesc function
For this type of scattered data you can use scatter, something like this: scatter(data(:,1),data(:,2),23,data(:,3),'filled') o...

24 días ago | 0

| accepted

Load more