Community Profile

# Bjorn Gustavsson

### UIT, the Arctic University of Norway

819 total contributions since 2001

#### Bjorn Gustavsson's Badges

View details...

Contributions in
View by

How to find integral over 2D image
If you want to have dW at the same resolution as your original image, just add the four terms together. If you want some local s...

6 hours ago | 0

Intersection of a 2D polygon in 3D and a straight line
OK, you'll get a bit of pseudo-code/algebra, that solves most of the problem. Lets write the equation for the plane as: that ...

12 hours ago | 0

Gaussian envelope on the diagonal of a matrix
Something like this: [x,y] = meshgrid(0:32); M = exp(-(x-y).^2/4^2); imagesc(x(1,:),y(:,1),M) Adjust width as you see fit. ...

2 days ago | 1

How do I add scale markers to the legend, to indicate values for the sizes of points in a scatter plot?
I'd do something like: sz = 12:2:24; % your suitable selection for your dimentionC-mapping-to-size y4size = linspace(45,110,...

3 days ago | 0

| accepted

Solved it, thanks anyway
Have a look at the help and documentation of the convhull function. HTH

3 days ago | 0

Differentiate with respect to a symbolic function
When I've used the Euler-Lagrange method I've used this tool: Euler-Lagrange tool (that handles this). If you need to solve a pr...

3 days ago | 1

Change folder that Matlab saves session information
Which version are you using? How much space does .matlab take? On my machine I have subdirectories for 2013a, 2015a and 2020a,...

4 days ago | 0

| accepted

Cannot calculate gradient of contour plot
If you modify your call to gradient to: [FU, FV] = gradient(F, diff(y(1:2)), diff(x(1:2))); You get a more reasonable set of q...

4 days ago | 0

| accepted

I would like to take double integral over standard normal distribution but it does not work.
Your problem might be that the symbolic toolbox have no way of knowing that your correlation is between -1 and 1. If you try the...

4 days ago | 0

| accepted

I tried to run my script written in 2017a in R2020b: Error using load Unable to read file 'coast.mat'. No such file or directory. Any idea on how to solve it?
Well you will somehow find the missing file. The reason you now get the error is because matlab-2020b for some reason cannot fin...

5 days ago | 0

Why am I warned about defining variables in a nested function, when I don't?
Because nested functions share the name-space with its parrent function. That is all variables in the parrent function are avail...

5 days ago | 4

How to write a video from png files and/or matlab figures
Try modifying your call to writeVideo to this: currFrame = getframe(gcf); writeVideo(vidObj,currFrame); HTH...

5 days ago | 0

| accepted

how do i make this contour plot more presentable
The crossing contours confuse/worry me, are you adding additional contours from another data-set ontop of your contourf-plot? ...

5 days ago | 0

| accepted

Contourf fill smaller instead of larger
You "simply" have to create a colormap that is white (or suitable levels of pale, or black in case of that making more esthetic ...

6 days ago | 0

Is it possible to determine the angle of rotation for this graph?
If you have your signals in y1 and y2 you can try to use circshift with an incremental shift until you see a reasonable fit. You...

6 days ago | 0

| accepted

How to create 2D Polar (r, theta) mesh?
What's not good enough with something like this: n_phi = 15 phi = linspace(0,pi/2,n_phi+1); % should give you 15+1 edges and 1...

7 days ago | 1

Submitted

Skymap
SKYMAP An easy to use medium accuracy astronomical starchart, with high-resolution stellar spectra, and a intuitive GUI

7 days ago | 5 downloads |

plotting of |y| graph
plot(t,abs(y)) HTH

9 days ago | 0

| accepted

Integration with both limits variable
Matlab has both a numerical and a symbolic version of the error-function. That will be the answer to your problem. The numeric v...

9 days ago | 0

Reduce computational time for ODE solver
Have you tried the other ODE-integrating functions? From your problem description it sounds like your ODEs are stiff - for that ...

9 days ago | 0

| accepted

2D colormaps. MxN matrix of RGB values for 4 colors gradient
If you do something like this: [hsvImg] = rgb2hsv(Imrgb); x_lims = [1 184; 199 383; 397 581; ...

11 days ago | 1

Integrating min and max function
This might not be the most elegant solution to this, but it's a first stab. Take a quick-look at what the function looks like: ...

11 days ago | 1

Maximization of a Function
When I create a sequence of functions like that I always have to have the input-variables explicitly visible on the right-hand s...

13 days ago | 0

Improving the computation speed of loops
When you want to search for ways to optimize your code always run it with the profiler to identify where the time is spent. pro...

13 days ago | 0

| accepted

Image fusion of 3 images
Perhaps: Im_fused = Im1/3 + Im2/3 + Im3/3; or more generally: w = [1 2 3]; w = w/sum(w); Im_wfused = w(1)*Im1 + w(2)*Im2 + ...

13 days ago | 0

Legend Color doesn't Match the Curves Color
That's peculiar. What happens if you keep the plot-handle from your calls to semilogy and send that to legend? ph = semilogy(z,...

13 days ago | 0

Fourier transform of a picture?
Note that the actual Fourier transform is the second row of your equation, while the first factor you can see as a matrix with n...

17 days ago | 1

Harmonic Oscilation. When I plot f towards time amplitude is increasing I don't know why. It should be constant. what's wrong?
Well if you have an equation of motion you should write it as an ordinary differential equation and solve it with a more ambitio...

18 days ago | 0

| accepted

Submitted