Answered

Using a loop to replace spaces for underscore

Ye gods, that is a complicated way to solve a job poorly. Sorry, but it is. Two lines, assuming you want the result in outstring...

Using a loop to replace spaces for underscore

Ye gods, that is a complicated way to solve a job poorly. Sorry, but it is. Two lines, assuming you want the result in outstring...

3 hours ago | 0

Answered

How to print 0 without a negative sign in the front? Everytime I want to print 0 it prints -0.000.

That minus zero is NOT truly zero. It is just a tiny number that is slightly less than zero, but when rounded to only 4 digits f...

How to print 0 without a negative sign in the front? Everytime I want to print 0 it prints -0.000.

That minus zero is NOT truly zero. It is just a tiny number that is slightly less than zero, but when rounded to only 4 digits f...

6 hours ago | 1

Answered

How to set which part of the code to comment using a variable?

NO. You do NOT want to comment out code programmatically. That will NOT be faster, even if you can find a way to do it. Your pro...

How to set which part of the code to comment using a variable?

NO. You do NOT want to comment out code programmatically. That will NOT be faster, even if you can find a way to do it. Your pro...

14 hours ago | 0

Answered

ERROR Not enough input arguments.

You DON'T "run" a function. Run applies to scripts, and soon you will almost forget the run command ever existed, or so I hope. ...

ERROR Not enough input arguments.

You DON'T "run" a function. Run applies to scripts, and soon you will almost forget the run command ever existed, or so I hope. ...

1 day ago | 0

Answered

I'm plotting a solution to a PDE using surf but the graph turns out wrong?

Do you understand that the series you show is not the same as what you wrote in code? Where did the sin term go in your code? W...

I'm plotting a solution to a PDE using surf but the graph turns out wrong?

Do you understand that the series you show is not the same as what you wrote in code? Where did the sin term go in your code? W...

3 days ago | 0

| accepted

Answered

Solve a Set of Equations with Constraints and Interchangeable Varaibles

I think you are worrying about some magic algorithm, when simple linear algebra will suffice. Yes. LINEAR algebra. Each equatio...

Solve a Set of Equations with Constraints and Interchangeable Varaibles

I think you are worrying about some magic algorithm, when simple linear algebra will suffice. Yes. LINEAR algebra. Each equatio...

3 days ago | 1

Answered

how to find area under the curve ?

Easy. Just use trapz. help trapz

how to find area under the curve ?

Easy. Just use trapz. help trapz

3 days ago | 0

| accepted

Answered

Confusino regarding statistical tests for given distribution

It looks FAIRLY normal. But you have a whole crapload of data. It needs to look more normal than that. When you have a lot of da...

Confusino regarding statistical tests for given distribution

It looks FAIRLY normal. But you have a whole crapload of data. It needs to look more normal than that. When you have a lot of da...

4 days ago | 0

Answered

How to do curve fitting by a user defined function

How far out do you want to extrapolate? This curve does NOT look like a sigmoid, because a sigmoidal curve will go flat at each ...

How to do curve fitting by a user defined function

How far out do you want to extrapolate? This curve does NOT look like a sigmoid, because a sigmoidal curve will go flat at each ...

5 days ago | 0

| accepted

Answered

non continuous double integration

Ok, now that we understand the question, it is easy. Just use trapz, TWICE. To apply the trapezoidal rule, you will create a ma...

non continuous double integration

Ok, now that we understand the question, it is easy. Just use trapz, TWICE. To apply the trapezoidal rule, you will create a ma...

6 days ago | 0

Answered

How do I change the position of the axes permanently?

There are some defaults you can set as defaults, but XAxisLocation and YAxisLocation do not appear to fall under the list of thi...

How do I change the position of the axes permanently?

There are some defaults you can set as defaults, but XAxisLocation and YAxisLocation do not appear to fall under the list of thi...

7 days ago | 0

Answered

How to perform Newman Girvan community detection algorithm in Matlab

My gut would have said probably not. But then Google is our friend. Why would you not look? Surely a 10 second search was easier...

How to perform Newman Girvan community detection algorithm in Matlab

My gut would have said probably not. But then Google is our friend. Why would you not look? Surely a 10 second search was easier...

7 days ago | 0

Answered

How to plot a 3D graph?

This is a perfect problem for a tool like ezsurf. Z = @(X,Y) 5 - sqrt(1 - X.^2 - (Y - abs(X)).^2).*cos(30.*(1 - X.^2 - (Y - abs...

How to plot a 3D graph?

This is a perfect problem for a tool like ezsurf. Z = @(X,Y) 5 - sqrt(1 - X.^2 - (Y - abs(X)).^2).*cos(30.*(1 - X.^2 - (Y - abs...

11 days ago | 0

| accepted

Answered

How to calculate roots for multiple polynomial equations simultaneously i.e. without iterating over them one by one

In fact, the simple answer is YES. It is trivial. No loop required. You have a set of QUADRATIC EQUATIONS!!!!!! Surely you lear...

How to calculate roots for multiple polynomial equations simultaneously i.e. without iterating over them one by one

In fact, the simple answer is YES. It is trivial. No loop required. You have a set of QUADRATIC EQUATIONS!!!!!! Surely you lear...

13 days ago | 0

| accepted

Answered

Fit Curve to a "C" shape

A spline produces a FUNCTION, SINGLE VALUED. That is, for any x, it is assumed there is a single y. Is that the case for you? NO...

Fit Curve to a "C" shape

A spline produces a FUNCTION, SINGLE VALUED. That is, for any x, it is assumed there is a single y. Is that the case for you? NO...

14 days ago | 1

| accepted

Answered

Solving a complex equation with all real answers

I hope this is not homework, because it is almost too simple. At the same time, it has an interesting twist. I still fear it is ...

Solving a complex equation with all real answers

I hope this is not homework, because it is almost too simple. At the same time, it has an interesting twist. I still fear it is ...

15 days ago | 0

| accepted

Answered

How to find absolute maximum value of (x*(x-.25)*(x-.5)*(x-1))

You are mixing numerical functions with symbolic tools. The two do not mix that well. So just pick ONE, and stay with it. For e...

How to find absolute maximum value of (x*(x-.25)*(x-.5)*(x-1))

You are mixing numerical functions with symbolic tools. The two do not mix that well. So just pick ONE, and stay with it. For e...

17 days ago | 0

| accepted

Answered

Getting the equation of a line

You did the fit, with the estimates of the coefficients in p. p is a vector, of length 2. The line equation is simple. y ...

Getting the equation of a line

You did the fit, with the estimates of the coefficients in p. p is a vector, of length 2. The line equation is simple. y ...

17 days ago | 1

Answered

How can I extract two matrices 6x6(unknown) and 6x1(known) multiplied together to form 6x1(known) matrix. As it isn't a square matrix I cannot perform inverse. Kindly suggest what can be done

I am way too late for a useful answer. As has been said, the solution is not unique. (You do not need to use fsolve.) I'll assu...

How can I extract two matrices 6x6(unknown) and 6x1(known) multiplied together to form 6x1(known) matrix. As it isn't a square matrix I cannot perform inverse. Kindly suggest what can be done

I am way too late for a useful answer. As has been said, the solution is not unique. (You do not need to use fsolve.) I'll assu...

18 days ago | 0

Answered

How to Derivative with bigger jumps than 1

I once wrote a tool that would take a vector, and find the smoothest vector consistent with the original vector, that was consis...

How to Derivative with bigger jumps than 1

I once wrote a tool that would take a vector, and find the smoothest vector consistent with the original vector, that was consis...

19 days ago | 0

| accepted

Answered

Calculating a function variable for a specific output

You will need a guess for z. I'll call it z0. zsolve = fzero(@(z) T(x,y,z) - Tend,z0);

Calculating a function variable for a specific output

You will need a guess for z. I'll call it z0. zsolve = fzero(@(z) T(x,y,z) - Tend,z0);

20 days ago | 1

Answered

How to fit an exponential curve with known error bars

Some thoughts ... Here is your data: X=[-504,-494,-490,-484,-478,-456,-436,-402,-364,-322]*10^-6; Y=[4.85,4.37,4.07,3.65,3.24...

How to fit an exponential curve with known error bars

Some thoughts ... Here is your data: X=[-504,-494,-490,-484,-478,-456,-436,-402,-364,-322]*10^-6; Y=[4.85,4.37,4.07,3.65,3.24...

20 days ago | 0

| accepted

Answered

Why doesn't [] ~=1 yield logical one?

This has always been true as I recall, probably so since the mid-1980's, when I learned MATLAB. Note that the result is an EMPT...

Why doesn't [] ~=1 yield logical one?

This has always been true as I recall, probably so since the mid-1980's, when I learned MATLAB. Note that the result is an EMPT...

21 days ago | 2

Answered

solve the question ( fsolve , vpasolve)

I think you do not understand optimization. When you change the initial value, it is EXPECTED that the solver MAY converge to a ...

solve the question ( fsolve , vpasolve)

I think you do not understand optimization. When you change the initial value, it is EXPECTED that the solver MAY converge to a ...

21 days ago | 0

Answered

Problem 45396. Design a tubesheet for shell-and-tube heat exchangers

I won't do your homework for you, and you clearly have been asked to think about this, not to ask someone else to think about it...

Problem 45396. Design a tubesheet for shell-and-tube heat exchangers

I won't do your homework for you, and you clearly have been asked to think about this, not to ask someone else to think about it...

21 days ago | 1

Answered

why expm dose not show parameters?

A is a classic example of a defective matrix. https://en.wikipedia.org/wiki/Defective_matrix As such, it cannot be diagonalize...

why expm dose not show parameters?

A is a classic example of a defective matrix. https://en.wikipedia.org/wiki/Defective_matrix As such, it cannot be diagonalize...

22 days ago | 1

| accepted

Answered

How to expand the solve answer?

You want to convert them to floating point numbers. syms x y = 3*x.^2 - 10*x + 1.01; xsol = solve(y == 1, x); vpa(xsol) %...

How to expand the solve answer?

You want to convert them to floating point numbers. syms x y = 3*x.^2 - 10*x + 1.01; xsol = solve(y == 1, x); vpa(xsol) %...

23 days ago | 1

Answered

How to calculate between the elements in an array for consecutive indexes.

idx_1 = [32,33,34,35,36,37,38,39,40]; % 1 set of consecutive numbers idx_2 = [32,33,35,36,37,38,40,41,42]; % 3 sets of consec...

How to calculate between the elements in an array for consecutive indexes.

idx_1 = [32,33,34,35,36,37,38,39,40]; % 1 set of consecutive numbers idx_2 = [32,33,35,36,37,38,40,41,42]; % 3 sets of consec...

23 days ago | 1

| accepted

Answered

Can Ridge Regression solve my problem?

Don't buy a toolbox, if your only reason is to hope to use it to solve a problem where you don't fully understand how or why you...

Can Ridge Regression solve my problem?

Don't buy a toolbox, if your only reason is to hope to use it to solve a problem where you don't fully understand how or why you...

24 days ago | 0

| accepted

Answered

How do I declare a for loop with a given number of elements?

I'll only have a loop 5 elements long, as I'm feeling tired right now. :) jvals = linspace(0,0.03,5); for j = jvals disp(j)...

How do I declare a for loop with a given number of elements?

I'll only have a loop 5 elements long, as I'm feeling tired right now. :) jvals = linspace(0,0.03,5); for j = jvals disp(j)...

28 days ago | 1

| accepted