Community Profile

photo

Bjorn Gustavsson


UIT, the Arctic University of Norway

106 total contributions since 2015

Contact

Bjorn Gustavsson's Badges

  • Revival Level 1
  • Knowledgeable Level 3
  • 6 Month Streak
  • First Answer

View details...

Contributions in
View by

Answered
Errorbars on scatter plot
You could use something like this function: function h = scatter_ellipse(X,Y,C,Cov,varargin) %SCATTER_ELLIPSE - colored ellips...

7 dagen ago | 0

Answered
Cumtrapz for matrix including NaN values
Well, I think that in addition to calculating a cummulative integration you also should/need to extract the limits over which yo...

7 dagen ago | 0

| accepted

Answered
mean and Standard deviation of ratio of normal variables?
Well, you have the document to read. If that's not good enough there is always: Ratio-distributions (wikipedia), Distribution-...

8 dagen ago | 0

Answered
Deconvolution of a Convolved Gaussian and Expoential curve
To my understanding the deconv-functions work for evenly spaced data. In your case I'd either try to do the convolution analytic...

12 dagen ago | 0

| accepted

Answered
Plot data points as points when using 'errorbar'
Doesn't this work for you?: errorbar(x,y,e,'.-','markersize',18) HTH

12 dagen ago | 0

| accepted

Answered
fitting a function with 3 parameter
This is a simple linear fitting problem, you solve it this way: M = [x(:),y(:),z(:)]; % creating a matrix of all your independe...

15 dagen ago | 0

Answered
How to change r code to Matlab
Well if it is as simple as a fit of a line to data you can always use polyfit, or lscov if you have known uncertainties in your ...

17 dagen ago | 0

| accepted

Answered
Delete specific contour line from contour plot
It is not obvious to me which contour you want to remove, but if you don't want, for example the 0-level contour you do: contou...

17 dagen ago | 0

| accepted

Answered
how to interpolate x and y coordinates of contour?
You extract the contours wrong, at least if you have multiple contours at the same level v(i). It is simpler if you plot all the...

17 dagen ago | 0

| accepted

Answered
How to superimpose images, making one of them transparent
Perhaps something like this: B = imread('peppers.png'); % Just to get a sample image subplot(2,2,1) imagesc(B) [i1,j2] = gin...

17 dagen ago | 0

Answered
exponential function phase reversal
Try: phi = linspace(-5*pi,5*pi,5*360+1); Phi = angle(exp(1i*phi)); plot(phi,Phi) grid on set(gca,'XTick',[-2.5*360:180:2.5*...

18 dagen ago | 0

Answered
Vectorizing nested for loops
You find a nice contribution from J Kirk on the file exchange: Distmat In my historic appreciation efforts there is this Acklam...

19 dagen ago | 1

Answered
Parse Error in funtion
Simples, k++ is not valid matlab syntax, sadly according to some, but fact. You'll have to do an excplicit incrementations: ...

19 dagen ago | 0

| accepted

Answered
imwarp large image running out of memory
Maybe you can get weasle your way around the problem by divide-and-conquer? Would it work if you applied your warping on a sub-s...

19 dagen ago | 0

Answered
Plot a Contour with no zigzag
If you have access to the spap2 you could try that function, I'd take a stab at converting your contour-data from Cartesian [X,Y...

24 dagen ago | 0

Answered
How to perform a truncated SVD
That was an uggly uggly G-matrix. When solving inverse problems the truncation-point is not to be selected close to "at double-p...

25 dagen ago | 1

| accepted

Answered
need help about coherence filter
Have a look at the excellent nonlinear-diffusion-toolbox. It contains functions for coherence-enhancing non-linear diffusion fil...

26 dagen ago | 0

Answered
Multiple EEG-files to one spectrogram
If there is time-gaps in your data-sequence, just do the individual spectrograms as per usual, I'd use something like this: dat...

26 dagen ago | 1

Answered
Figures with large amounts of data don't export properly to .eps
The solution to avoid this arbitrary choise of output renderer is to explicitly select painters: print('-depsc2','-painters',fi...

26 dagen ago | 0

| accepted

Answered
Saving all the variables from an ode45 Function
It seems your w is a scalar, and you've defined Yi11 and Yi12 as global constants (warnings should come but I'll assume you have...

ongeveer een maand ago | 0

Answered
How do I name the trendline in the legend? Also, how can I get the trend line equation on the plot?
Maybe: if c(2) > 0 equation_string = sprintf('%4.3f x + %4.3f',c(1),c(2)); elseif c(2) < 0 equation_string = sprintf('%4...

ongeveer een maand ago | 0

Answered
Fitting Lennard-Jones to Morse
First you need to make these potentials comparable - now your LJ12-6 has the dissociation-energy as the zero-level, while your M...

ongeveer een maand ago | 0

| accepted

Answered
How do I ensure that the animation remain within the axis limit?
Well you could achieve that by doing something like: plot(p(1,:),p(2,:),'k.','LineWidth',3,'Markersize',15); axPcurr = axis; ...

ongeveer een maand ago | 0

| accepted

Answered
Plotting coastlines at different levels in a 3D plot
Since you've selected to set zdir to 'reverse' your coastline-plot might look better something like this: z_bottom = max(get(gc...

ongeveer een maand ago | 1

| accepted

Answered
How to view the Frequency content of an image
Try something like: ftI = fft2(I); imagesc(log10(abs(ftI))) caxis([-6 0]+max(caxis)) Then you have the DC-component in the u...

ongeveer een maand ago | 0

Answered
How can I call the variables of MATLAB workspace from a function?
I suppose you can build something with the matlab-function evalin, Something like: savename = 'whatever.mat'; savecmd = ['save...

ongeveer een maand ago | 1

Answered
legendre function of second kind
You can find a toolbox for special functions on the file exchange: Computation of Special Functions I haven't (or at least don...

ongeveer een maand ago | 0

Answered
How do I save every nth Frame of a video and save these images to a folder of my choosing
If you follow the steps from the help on VideoReader, it should be perfectly possible to replace the frame-by-frame reading des...

ongeveer een maand ago | 0

| accepted

Answered
find index values in a 3D matrix above a threshold
To find indices to values larger than 1 do: [i1,i2,i3] = find(A>threshold); After that you might have to loop over the indices...

ongeveer een maand ago | 0

Answered
Using ginput with imshow: how to save pixel instead of axis coordinates
Not directly from ginput. You can easily do whatever rounding of the coordinates you've chosen directly after: [x,y] = ginput(2...

ongeveer een maand ago | 0

| accepted

Load more