Answered

Volume of overlapping ellipsoids

The simple solution is just to fill a 3-d array with voxels that are inside each ellipsoid. So, if a voxel is already filled, th...

Volume of overlapping ellipsoids

The simple solution is just to fill a 3-d array with voxels that are inside each ellipsoid. So, if a voxel is already filled, th...

environ 22 heures ago | 0

| accepted

Answered

generate 0 and 1

rand() < 0.6 If you want a random binary sequence of length n, then this is sufficient: rand(1,n) < 0.6

generate 0 and 1

rand() < 0.6 If you want a random binary sequence of length n, then this is sufficient: rand(1,n) < 0.6

2 jours ago | 0

| accepted

Answered

interrupt a function when it takes too long

This is not what parfor is designed to solve, nor even what you could reasonably solve with parfor. Since you are calling the f...

interrupt a function when it takes too long

This is not what parfor is designed to solve, nor even what you could reasonably solve with parfor. Since you are calling the f...

2 jours ago | 0

Answered

To create a code that differentiate any function

Well, you write a complete version of a set of symbolic tools, that can parse any function provided, and know the rules for diff...

To create a code that differentiate any function

Well, you write a complete version of a set of symbolic tools, that can parse any function provided, and know the rules for diff...

3 jours ago | 0

Answered

How can i extrapolate data?

Extrapolation is a dangerous thing to do. Best left to someone with sufficient expertise that they know when they are doing some...

How can i extrapolate data?

Extrapolation is a dangerous thing to do. Best left to someone with sufficient expertise that they know when they are doing some...

3 jours ago | 1

| accepted

Answered

How to Get Answers in Non-PolyGamma Form?

(I'm sorry that my answer is coming 9 years too late to be of any significant value to you personally. But someone else might fi...

How to Get Answers in Non-PolyGamma Form?

(I'm sorry that my answer is coming 9 years too late to be of any significant value to you personally. But someone else might fi...

3 jours ago | 0

Answered

Making contours in polar plot

You could at least spell my name right, since you had it right in front of you. Regardless, it turns out that you changed your ...

Making contours in polar plot

You could at least spell my name right, since you had it right in front of you. Regardless, it turns out that you changed your ...

4 jours ago | 0

Answered

How to fit custom polynomial equation?

You could download polyfitn from the file exchange. But if you already know how to use the curve fitting toolbox, then just spe...

How to fit custom polynomial equation?

You could download polyfitn from the file exchange. But if you already know how to use the curve fitting toolbox, then just spe...

4 jours ago | 0

| accepted

Answered

How to efficiently plot functions?

Wyhy not try it? I don't have t or y, so I'll make them up. t = (1:10)'; y = rand(10,12); plot(t,y) Actually, I don't need...

How to efficiently plot functions?

Wyhy not try it? I don't have t or y, so I'll make them up. t = (1:10)'; y = rand(10,12); plot(t,y) Actually, I don't need...

5 jours ago | 1

| accepted

Answered

How can I creat a lower triangular with one vektor avoiding for loops?

Will it always be a matrix of that form? Or will you next ask how to fill the lower triangle with a fully general set of numbers...

How can I creat a lower triangular with one vektor avoiding for loops?

Will it always be a matrix of that form? Or will you next ask how to fill the lower triangle with a fully general set of numbers...

5 jours ago | 1

| accepted

Answered

How to use for loop and if else condition for multiple conditions

First, you don'r need a for loop that runs over system, sine you re just assigning it one value! That is, this: for system = 1 ...

How to use for loop and if else condition for multiple conditions

First, you don'r need a for loop that runs over system, sine you re just assigning it one value! That is, this: for system = 1 ...

5 jours ago | 0

| accepted

Answered

Distance between a point and the intersection of two spheres

This is confusing, possibly because of how you are trying to solve it. I think you are working too hard. The intersection betwe...

Distance between a point and the intersection of two spheres

This is confusing, possibly because of how you are trying to solve it. I think you are working too hard. The intersection betwe...

6 jours ago | 0

| accepted

Answered

How to plot polynomial function correctly?

Hmm. Why does this feel like deja vu? (Answer: I just answered almost the same question for someone else, not 5 minutes ago.) d...

How to plot polynomial function correctly?

Hmm. Why does this feel like deja vu? (Answer: I just answered almost the same question for someone else, not 5 minutes ago.) d...

6 jours ago | 1

Answered

Plotting a graph with a confusing equation

How to lie with statistics. ;-) (Yes, that is the name of a little book I read long ago.) My point is, not that you or anyone i...

Plotting a graph with a confusing equation

How to lie with statistics. ;-) (Yes, that is the name of a little book I read long ago.) My point is, not that you or anyone i...

6 jours ago | 1

| accepted

Answered

Matrices with different numbers of equations

You know the size of the matrix. You already know you need to use zeros to initialize it. A = zeros(2*N,2*N); b = zeros(2*N,1)...

Matrices with different numbers of equations

You know the size of the matrix. You already know you need to use zeros to initialize it. A = zeros(2*N,2*N); b = zeros(2*N,1)...

6 jours ago | 1

Answered

plotting a natural cubic spline

Are you allowed to use existing code? So if you have the curve fitting toolbox, you can just use csape. x = 0:4; y = [1 3 3 4 ...

plotting a natural cubic spline

Are you allowed to use existing code? So if you have the curve fitting toolbox, you can just use csape. x = 0:4; y = [1 3 3 4 ...

6 jours ago | 1

Answered

Find the vector sum combination that gives the minimum vector length

First, NEVER store data in multiple variables like this. Instead, LEARN TO USE ARRAYS. There is no reason why you cannot store a...

Find the vector sum combination that gives the minimum vector length

First, NEVER store data in multiple variables like this. Instead, LEARN TO USE ARRAYS. There is no reason why you cannot store a...

7 jours ago | 2

| accepted

Answered

Unrecognized function or variable 'carsmall'

This is not a question of you updating your version. I can see what you did, but not what you were hoping to do. Suppose I try t...

Unrecognized function or variable 'carsmall'

This is not a question of you updating your version. I can see what you did, but not what you were hoping to do. Suppose I try t...

7 jours ago | 1

| accepted

Answered

Is the Trapz feature always accurate?

trapz is not a "feature". It is a piece of software that embodies the trapezoidal rule, something that students may be exposed t...

Is the Trapz feature always accurate?

trapz is not a "feature". It is a piece of software that embodies the trapezoidal rule, something that students may be exposed t...

7 jours ago | 1

Answered

Why do I get this error in my Taylor Expansion?

It might seem a subtle point. But what is the shape of sqrt(sin(x)), where x is near zero? (I'll just disregard the +2, since th...

Why do I get this error in my Taylor Expansion?

It might seem a subtle point. But what is the shape of sqrt(sin(x)), where x is near zero? (I'll just disregard the +2, since th...

7 jours ago | 1

Answered

What is the reason that a Hessian should be positive definite? And what is the relation between an ill-conditioned Hessian and convergence?

(This is not really a MATLAB question, but you are asking a question about the behavior of MTLAB solvers. Therefore close enoug...

What is the reason that a Hessian should be positive definite? And what is the relation between an ill-conditioned Hessian and convergence?

(This is not really a MATLAB question, but you are asking a question about the behavior of MTLAB solvers. Therefore close enoug...

8 jours ago | 1

Answered

Why can't I write this row vector?

Very often, people who are just starting to use MATLAB, think that if you don't know the value of something, then it must be sym...

Why can't I write this row vector?

Very often, people who are just starting to use MATLAB, think that if you don't know the value of something, then it must be sym...

8 jours ago | 2

| accepted

Answered

Hyerbolic Functions causing issues with Contour Plots.

Ugh. Learn how to use MATLAB, and scrap the crapola inpuptdlg interface. Next, learn NOT to use variable names like a lower cas...

Hyerbolic Functions causing issues with Contour Plots.

Ugh. Learn how to use MATLAB, and scrap the crapola inpuptdlg interface. Next, learn NOT to use variable names like a lower cas...

9 jours ago | 0

Answered

Linears equations summation+combination optimization

Let me see. The use of globals here is unecessary, better would have been to use anonymous functions. Globals just complicate ho...

Linears equations summation+combination optimization

Let me see. The use of globals here is unecessary, better would have been to use anonymous functions. Globals just complicate ho...

9 jours ago | 1

Answered

Making a Matrix Strictly Diagonally-Dominant

Can you solve this? Yes, sometimes, and there is no need for random permutations of the matrix. In fact, that is a poor solution...

Making a Matrix Strictly Diagonally-Dominant

Can you solve this? Yes, sometimes, and there is no need for random permutations of the matrix. In fact, that is a poor solution...

10 jours ago | 0

Answered

How would i adapt this code to make it work for a whole phrase, not just one word?

Simplest would be to extract each word, one at a time. For example, consider this sentence (taken from your question): phrase =...

How would i adapt this code to make it work for a whole phrase, not just one word?

Simplest would be to extract each word, one at a time. For example, consider this sentence (taken from your question): phrase =...

11 jours ago | 0

Answered

How can i replace all positive values of a matrix whit their square root ?

If you need to do it in one line, this will work: A(A>0) = sqrt(A(A>0)); Or, you could do the test in advance, saving some CPU...

How can i replace all positive values of a matrix whit their square root ?

If you need to do it in one line, this will work: A(A>0) = sqrt(A(A>0)); Or, you could do the test in advance, saving some CPU...

11 jours ago | 1

Answered

How to quickly find the column index of the last non-zero element in all rows in a sparse matrix?

It is important that if your matrix is sparse, that we use sparse matrix examples to test anything out. Regardless, I would alw...

How to quickly find the column index of the last non-zero element in all rows in a sparse matrix?

It is important that if your matrix is sparse, that we use sparse matrix examples to test anything out. Regardless, I would alw...

11 jours ago | 3

Answered

Find ones blocks in upper triangular matrix

Let me plead for you to change how you are doing things. What you are asking to do is perhaps the most silly form of information...

Find ones blocks in upper triangular matrix

Let me plead for you to change how you are doing things. What you are asking to do is perhaps the most silly form of information...

11 jours ago | 0

| accepted

Answered

How to find cct of LEDs in cie 1960 graph?

I don't have the data you show for those curves. However, an orthogonal projection of a point onto a curve in space is not that ...

How to find cct of LEDs in cie 1960 graph?

I don't have the data you show for those curves. However, an orthogonal projection of a point onto a curve in space is not that ...

11 jours ago | 1