Community Profile

# Bjorn Gustavsson

### UIT, the Arctic University of Norway

344 total contributions since 2015

View details...

Contributions in
View by

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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