Community Profile

photo

Bjorn Gustavsson


UIT, the Arctic University of Norway

206 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
Create coordinates on a convex hull
Perhaps this function is overkill, but to me it seems as if this FEX-contribution should help: xy2sn, I don't know if it is the...

3 days ago | 0

Answered
how to draw a 3d surface of exp(x+iy)
Have a look at the dcolor submission to the file exchange. That should give you a good starting point for doing this. There ar...

4 days ago | 1

Answered
Rotate 3D quiver
Matlab uses right-handed coordinate systems (sensible), with the default convention that z is in the upward vertical direction i...

6 days ago | 0

Answered
Visualization of Euler angles
Maybe something as simple as plotting the unit-vectors before and after a rotation? That is something you can easily adapt and ...

6 days ago | 0

Answered
How do I declare and iterate a variable in an ODE driver file?
The way I read your ODE-function your Snh_in_1 is the initial value of the second component of y. If so it should be no more dif...

7 days ago | 0

Answered
Plotting a 2D crystal lattice from two primitive lattice vectors
If you do it stepwise it becomes "not too tricky": e1 = [-0.5; -sqrt(3)/2]; % Your unit e2 = [1; 0]; % vectors ...

7 days ago | 1

Answered
How to do matrix or table multiplication?
Looping seems simplest and most easily readable for humans: szI = size(IntakeTable); szE = size(ExhaustTable); resultTable = ...

9 days ago | 1

Answered
This how i want the plot to be
pcolor(x,y,I),shading flat,xlabel('x-text'),ylabel('y-text'),colorbar HTH

10 days ago | 0

Answered
How to store large data sets with different types of information?
If you're planning to run all analysis in matlab why not just store everything in a .mat-file. In this scenario just have a sit-...

11 days ago | 0

| accepted

Answered
indepvar and depvar are of inconsistent sizes with polyfitn
Yes, you send in an array [x1,x2] of size [1 x 20] and an array y of size [ 1 x 10] into polyfitn. The polyfitn version I have (...

11 days ago | 1

| accepted

Answered
Can someone answer this?
Yes most people reading these pages can. You can too. Your learning experiece depends crucialy on your effort to learn. Check th...

16 days ago | 0

Answered
Plotting 4D data
Try something like this: t = M(:,1); x = M(:,2); y = M(:,3); z = M(:,4); scatter3(x,y,z,32,t,'filled') HTH

18 days ago | 1

| accepted

Answered
Can anyone help in this error Error: The expression to the left of the equals sign is not a valid target for an assignment.
It looks like you should first check that the string generated by your strcat function call. To me it look like you generate an ...

20 days ago | 0

Answered
matrix multiplication error with too many variables in the equation .
Your first multiply are a matrix multiplication, you can achieve what you want if you make sure that C is a column-vector and t...

20 days ago | 0

| accepted

Answered
Try using or tightening upper and lower bounds on coefficients.
For arbitrary fitting tasks I personally prefer to use weighted least-square minimization using some optimization function, if ...

20 days ago | 0

Answered
How to obtain variables from a structure inside a for loop?
It seems that you read in entire data-sets into a number of numbered struct-variables (presumably s_1, s_2,..., s_25). Dont do t...

21 days ago | 0

| accepted

Answered
How to plot quiver with an input of Temperature data?
Presumably your heat-flux is just proportional to the temperature gradient (assuming constant and isotropic heat conductivity), ...

1 month ago | 1

| accepted

Answered
Use conditional statements to separate elements from a single array into 2 new arrays
Are you trying to separate points that have no neighbours closer than HS_HS_threshold from those that have? If so this should d...

1 month ago | 0

| accepted

Answered
How to draw cumulative histogram?
Simplest would be something like this: bins = [ 10 10 20 40 50 60 70 80 80 80 90 90 90 100 100 100 100 100 ]; data = [...

2 months ago | 0

Answered
Problems using ODE45 using fmincon command for least square optimisation problem
Your first function is messed up with code after the end that closes the function myObjective, try this change function chisqua...

2 months ago | 0

Answered
How can I get then angle between a line connecting two points in the plot and a vector (with only direction specified)?
Best way to go about this is to convert the "wind"-direction to a wind-vector, then use: w_angle = atan2(norm(cross(wv,b)), dot...

2 months ago | 0

Answered
how to plot a multiple 4d array on same graph
It is still a bit unclear exactly what type of data you have, but multiple 4-D data in one graph is a lot of information to dige...

2 months ago | 0

| accepted

Answered
Error encountered with decomposing time series
try to call the function with either ,...,'model','additive') % property-value pairs or with a variable model my_model = 'add...

2 months ago | 0

Answered
Finding the correlation coefficient between two images
You should be able to get the 2 x 2 correlation matrix this way: ImgCorr = corrcoef(double(Im1(:)),double(Im2(:))); From that ...

2 months ago | 0

Answered
I have a variable named T_t which is of dimension [1 20]. How do i add a normal error with a standard deviation of 1 to it?
Well, you would only get a standard deviation approximately equal to 1 if you have T_t constant for all 20 elements. If you comp...

2 months ago | 0

| accepted

Answered
Visualising Volume Object Data
You could work with surf on each radial layer and set the surface property facealpha to something transparent. Perhaps something...

2 months ago | 0

| accepted

Answered
change in a image
The only meaningful interpretation I can come up with is that you have two images of the same scene taken from a static camera (...

2 months ago | 0

Answered
use Tic Toc for function
Either scrap cellfun and loop over the elements of A, or plug tic-toc into your test-function.

2 months ago | 0

| accepted

Answered
Rename files within multiple subfolders (within multiple subfolders) to the name of the first subfolder.
Why not do something like: target_dir = fullfile('C:\Users\johan\Skrivbord\test'); source_root = fullfile('C:\Users\johan\Sk...

2 months ago | 0

Answered
symbolic equation to numerical answer
Take a look at matlabFunction, it should be the function to use to convert a symbolic expression to a numerical functin. HTH

2 months ago | 0

| accepted

Load more