Answered

Random set of vectors and sort them via the x axis

Have a look at the help and documentation of the function sortrows. Also (if this is a educational programming task) read the he...

Random set of vectors and sort them via the x axis

Have a look at the help and documentation of the function sortrows. Also (if this is a educational programming task) read the he...

6 hours ago | 0

Answered

How to control color and the intensity in a pcolor figure?

You could try something like this: lambda = 400:700; % Wavelengths in nm. I_of_lambda = % Solar-spectral intensity as a functi...

How to control color and the intensity in a pcolor figure?

You could try something like this: lambda = 400:700; % Wavelengths in nm. I_of_lambda = % Solar-spectral intensity as a functi...

1 day ago | 1

| accepted

Answered

Error using ode45

Perhaps your calling has become too "traditional" and is not properly supported. In that case (and in general) it might be enoug...

Error using ode45

Perhaps your calling has become too "traditional" and is not properly supported. In that case (and in general) it might be enoug...

1 day ago | 0

Answered

Adding Harmonics of a sine wave together

You have to take into account that the fft returns complex Fourier-coefficient - that is both real and imaginary components. So ...

Adding Harmonics of a sine wave together

You have to take into account that the fft returns complex Fourier-coefficient - that is both real and imaginary components. So ...

2 days ago | 0

Answered

How to plot scatter graph with colourmap functon

To make it short and simple couldn't you just use scatter and let it automatically scale the values? scatter(x,y,23,myVal,'fill...

How to plot scatter graph with colourmap functon

To make it short and simple couldn't you just use scatter and let it automatically scale the values? scatter(x,y,23,myVal,'fill...

2 days ago | 0

Answered

Double integral with rectangle transformation

No. Check things like this by simply doing things like this: [x,y] = meshgrid(linspace(-2,2,401)); pcolor(x,y,abs(x)+abs(y)),s...

Double integral with rectangle transformation

No. Check things like this by simply doing things like this: [x,y] = meshgrid(linspace(-2,2,401)); pcolor(x,y,abs(x)+abs(y)),s...

2 days ago | 0

Answered

ODE with time dependant variable

Go to the help and then online documentation for ODE45, there you will find illustrated examples for both multiple coupled ODEs ...

ODE with time dependant variable

Go to the help and then online documentation for ODE45, there you will find illustrated examples for both multiple coupled ODEs ...

2 days ago | 0

| accepted

Answered

Equal Axis reduce the plot size

That is a terrible problen, what happens in your case, with increasingly narrow axes is (likely) unavoidable when you get very d...

Equal Axis reduce the plot size

That is a terrible problen, what happens in your case, with increasingly narrow axes is (likely) unavoidable when you get very d...

2 days ago | 0

Answered

solving a coupled differential equations using ODE45

You have to put both ODEs together and integrate the pair at once. Let's look at an example equation: That pair of equations ...

solving a coupled differential equations using ODE45

You have to put both ODEs together and integrate the pair at once. Let's look at an example equation: That pair of equations ...

2 days ago | 1

| accepted

Answered

Let other applications use Matlab's version of the CUDA toolkit

0: I have no idea about legalities. 1, I found a lot with unix find: $ find ./ -iname \*cuda\*.so\* ./R2020a/bin/glnxa64/libo...

Let other applications use Matlab's version of the CUDA toolkit

0: I have no idea about legalities. 1, I found a lot with unix find: $ find ./ -iname \*cuda\*.so\* ./R2020a/bin/glnxa64/libo...

3 days ago | 0

Answered

How to more efficiently populate a sparse matrix

The general advice is to calculate and save the non-zero elements, and their array-indices, in 3 arrays and then once they've be...

How to more efficiently populate a sparse matrix

The general advice is to calculate and save the non-zero elements, and their array-indices, in 3 arrays and then once they've be...

3 days ago | 0

| accepted

Answered

vpaintegral() returns wrong answer for g(t) = (mod(t,5))^2

Peculiar. If you look at g(t) you will see (well in my version of matlab): g(t) = (mod(t,5))^2 g(t) = t^2 Which shows that t...

vpaintegral() returns wrong answer for g(t) = (mod(t,5))^2

Peculiar. If you look at g(t) you will see (well in my version of matlab): g(t) = (mod(t,5))^2 g(t) = t^2 Which shows that t...

4 days ago | 0

| accepted

Answered

Why is it that Matlab has so many data types?

Partial "answer": In the beginning there were the double (32-bit?) and the char, and everything was peaceful, then they ate of...

Why is it that Matlab has so many data types?

Partial "answer": In the beginning there were the double (32-bit?) and the char, and everything was peaceful, then they ate of...

5 days ago | 0

Answered

how to convert light spectral / intensity to RGB value?

Well I assume that you want to convert the envelope of the coloured region into a single RGB-tripplet. In your particular case I...

how to convert light spectral / intensity to RGB value?

Well I assume that you want to convert the envelope of the coloured region into a single RGB-tripplet. In your particular case I...

5 days ago | 0

Answered

Perform FFTW of a song

Instead of using the fft, that calculates one fourier-transform of the entire time-series, have a look at the spectrogram functi...

Perform FFTW of a song

Instead of using the fft, that calculates one fourier-transform of the entire time-series, have a look at the spectrogram functi...

5 days ago | 0

Answered

Break title into multiple lines? Part 2

This works: title1 = string('The first title-row'); title2 = string('Some Rosetta stonery'); title3 = string('Den sista titel...

Break title into multiple lines? Part 2

This works: title1 = string('The first title-row'); title2 = string('Some Rosetta stonery'); title3 = string('Den sista titel...

5 days ago | 0

| accepted

Answered

Multiplication of tranformation matrices gives strange result

You have confused permutation-matrices with mirroring and rotation-matrices. They are not the same. Your Rccw60 is not (what I t...

Multiplication of tranformation matrices gives strange result

You have confused permutation-matrices with mirroring and rotation-matrices. They are not the same. Your Rccw60 is not (what I t...

8 days ago | 0

Answered

How Do I plot Lat Long Altitude into a 2D countour

The problem you have is that you have coordinates for contours one level at a time, however since you have multiple closed loops...

How Do I plot Lat Long Altitude into a 2D countour

The problem you have is that you have coordinates for contours one level at a time, however since you have multiple closed loops...

9 days ago | 0

Answered

Minimize Difference in Partition Sums from Experimental Data

Yup, you will find the algorithm and information here: partition problem (wikipedia). HTH

Minimize Difference in Partition Sums from Experimental Data

Yup, you will find the algorithm and information here: partition problem (wikipedia). HTH

9 days ago | 0

Answered

Newline in text files

When I want to explicitly write \n for new-line I include it explicitly in the string-specification: fid1 = fopen('Testfile.txt...

Newline in text files

When I want to explicitly write \n for new-line I include it explicitly in the string-specification: fid1 = fopen('Testfile.txt...

10 days ago | 0

| accepted

Answered

How to fix/steady the position of a counter in plot title.

Perhaps you can use the same type of zero-padding often used for filenames? Something like: tstr = sprintf('%04d',loop_idx); O...

How to fix/steady the position of a counter in plot title.

Perhaps you can use the same type of zero-padding often used for filenames? Something like: tstr = sprintf('%04d',loop_idx); O...

10 days ago | 0

Answered

Reshape data vector for a surf plot over a non-rectangular domain

If you have your x, y and z data in 1-D arrays you can use trisurf see the help and documentation for that function for usage. I...

Reshape data vector for a surf plot over a non-rectangular domain

If you have your x, y and z data in 1-D arrays you can use trisurf see the help and documentation for that function for usage. I...

10 days ago | 1

Answered

2d image reconstruction from 1D images

That definitely looks like the text-book definition of the Radon-iRadon transform pair setup. The limitation here is the 10 stri...

2d image reconstruction from 1D images

That definitely looks like the text-book definition of the Radon-iRadon transform pair setup. The limitation here is the 10 stri...

11 days ago | 0

Answered

Error: Index in position 1 exceeds array bounds

I think you would benefit from using the fact that there is information about the number of elements in a contour-segment in C. ...

Error: Index in position 1 exceeds array bounds

I think you would benefit from using the fact that there is information about the number of elements in a contour-segment in C. ...

11 days ago | 0

Answered

Interp1-Input coordinates must be real.

Then it must be because your theta_n has become complex. How that came to be is impossible to guess based on this information. I...

Interp1-Input coordinates must be real.

Then it must be because your theta_n has become complex. How that came to be is impossible to guess based on this information. I...

11 days ago | 0

Answered

correlation of two signal

Why do you want to use circshift? That would put some of your last samples first! That's not the way to go about this. To do th...

correlation of two signal

Why do you want to use circshift? That would put some of your last samples first! That's not the way to go about this. To do th...

11 days ago | 0

| accepted

Answered

ODE solving lack of span inputs

OK, you have 2 coupled ODEs. If I expand the D/Dt(log(V(t))) to 1/V(t)*D/Dt(V(t) I'd get something like this: function dVdtdcad...

ODE solving lack of span inputs

OK, you have 2 coupled ODEs. If I expand the D/Dt(log(V(t))) to 1/V(t)*D/Dt(V(t) I'd get something like this: function dVdtdcad...

12 days ago | 0

| accepted

Answered

ODE solving lack of span inputs

The error is most likely in the second ode45-call. In that subfunction the time t will always be a scalar. You might want to cha...

ODE solving lack of span inputs

The error is most likely in the second ode45-call. In that subfunction the time t will always be a scalar. You might want to cha...

12 days ago | 0

Answered

Defining ODE function as function file

The way you've coded ConcA it should solve an ODE that looks like this: That might very well be the ODE you need to solve, bu...

Defining ODE function as function file

The way you've coded ConcA it should solve an ODE that looks like this: That might very well be the ODE you need to solve, bu...

12 days ago | 0

Answered

How to use ODE solvers for a 2nd order differential equation with a Mass Matrix ?

As far as I understand all you have to is to do the same conversion from a system of second order ODEs to a twice as big system ...

How to use ODE solvers for a 2nd order differential equation with a Mass Matrix ?

As far as I understand all you have to is to do the same conversion from a system of second order ODEs to a twice as big system ...

12 days ago | 1

| accepted