43.963 total contributions since 2011

I do not do free private consulting. If you want to bring my attention to something, send a link to the MATLAB Answers location.

Answered

How can I print each piece of data in the following colum while iterating through a for loop with fprintf

It is possible to build up tables one column at a time. In order to do so, you need to work with character arrays and sprintf, o...

How can I print each piece of data in the following colum while iterating through a for loop with fprintf

It is possible to build up tables one column at a time. In order to do so, you need to work with character arrays and sprintf, o...

alrededor de 1 hora ago | 0

Answered

'trapz' to find area under curve not working

x=length(y) is a scalar value, just the length. You then pass that one length as the X coordinates and pass all of y as the Y co...

'trapz' to find area under curve not working

x=length(y) is a scalar value, just the length. You then pass that one length as the X coordinates and pass all of y as the Y co...

alrededor de 4 horas ago | 0

Answered

Getting rid of a for loop

value1 = find(input(1:end-2) > input(2:end-1) & input(2:end-1) < input(3:end)) + 1; value2 = input(value1);

Getting rid of a for loop

value1 = find(input(1:end-2) > input(2:end-1) & input(2:end-1) < input(3:end)) + 1; value2 = input(value1);

alrededor de 5 horas ago | 0

Answered

The crtrp function from the genetic-toolbox doesn't work

Line 34 can be deleted.

The crtrp function from the genetic-toolbox doesn't work

Line 34 can be deleted.

alrededor de 5 horas ago | 0

Answered

difference between two programs

X=imread('mosque.jpg'); The great majority of .jpg are RGB (grayscale is possible but very rare.) [n,m]=size(X); size() of a...

difference between two programs

X=imread('mosque.jpg'); The great majority of .jpg are RGB (grayscale is possible but very rare.) [n,m]=size(X); size() of a...

alrededor de 10 horas ago | 0

| accepted

Answered

X and Y must be same length, however they already are?

You do not store any x values, so it is [] after the reading loop.

X and Y must be same length, however they already are?

You do not store any x values, so it is [] after the reading loop.

alrededor de 10 horas ago | 1

| accepted

Answered

Why does solve() parametrize the results in the conditions?

Your nonnegative and positive constraints together with the ^2 impose boundaries. The equation has to be solved in ways that the...

Why does solve() parametrize the results in the conditions?

Your nonnegative and positive constraints together with the ^2 impose boundaries. The equation has to be solved in ways that the...

alrededor de 11 horas ago | 0

Answered

How can I solve the error of {Undefined operator '.^' for input arguments of type 'optim.problemdef.OptimizationExpression'}?

You cannot fix that problem in that release. The first release or two of Problem Based Optimization supported only linear proble...

How can I solve the error of {Undefined operator '.^' for input arguments of type 'optim.problemdef.OptimizationExpression'}?

You cannot fix that problem in that release. The first release or two of Problem Based Optimization supported only linear proble...

alrededor de 12 horas ago | 0

Answered

How do I save handles struct from a GUI as a .txt file in a way I can then uploaded back to the GUI?

If you do not care whether the file is human readable, then you can try using https://www.mathworks.com/matlabcentral/fileexchan...

How do I save handles struct from a GUI as a .txt file in a way I can then uploaded back to the GUI?

If you do not care whether the file is human readable, then you can try using https://www.mathworks.com/matlabcentral/fileexchan...

alrededor de 19 horas ago | 0

Answered

Using a tolerance in X with fzero function (by default the tolerance is evaluated on Y axis).

There is no mathematical way for fzero to be able to reliably detect that. You are asking that if you are currently at positio...

Using a tolerance in X with fzero function (by default the tolerance is evaluated on Y axis).

There is no mathematical way for fzero to be able to reliably detect that. You are asking that if you are currently at positio...

alrededor de 19 horas ago | 0

Answered

How to get out of the for cycle and start all over again?

a = 1; while true B = a*23+54 ; if B < 89 a = a+1; continue; end end Or more cleanly, a = 1...

How to get out of the for cycle and start all over again?

a = 1; while true B = a*23+54 ; if B < 89 a = a+1; continue; end end Or more cleanly, a = 1...

alrededor de 20 horas ago | 0

Answered

How to avoid permutation condition in Genetic Algorithm?

Use A and b constraints to enforce that the values are in sorted order. x(1) < x(2) if [1 -1]*x(1:2).' < 0 so A = [1 -1 0 0 0 0...

How to avoid permutation condition in Genetic Algorithm?

Use A and b constraints to enforce that the values are in sorted order. x(1) < x(2) if [1 -1]*x(1:2).' < 0 so A = [1 -1 0 0 0 0...

alrededor de 20 horas ago | 0

Answered

Ploting stack of matrices

If you have x being a 100 x 1 matrix, and y being as 100 x 4 x 4 matrix, then plot(x, reshape(y, size(y,1), [])) This would cr...

Ploting stack of matrices

If you have x being a 100 x 1 matrix, and y being as 100 x 4 x 4 matrix, then plot(x, reshape(y, size(y,1), [])) This would cr...

1 día ago | 0

Answered

ode45 error **help please**

ode45(@ex3_2ndorder, stuff You probably left out the @

ode45 error **help please**

ode45(@ex3_2ndorder, stuff You probably left out the @

1 día ago | 0

Answered

I don't have function "deeplabv3plusLayer" in Matlab 2019a

It was introduced in R2019b

I don't have function "deeplabv3plusLayer" in Matlab 2019a

It was introduced in R2019b

1 día ago | 1

Answered

Where does the getappdata() function save its data?

getappdata returns its output as regular output, same as a+b returns its output. You would want to store the output or use it in...

Where does the getappdata() function save its data?

getappdata returns its output as regular output, same as a+b returns its output. You would want to store the output or use it in...

1 día ago | 0

Answered

What function fits my data...?

There are an infinite number of functions that explain your data perfectly to within rounding error. It would be the infinity of...

What function fits my data...?

There are an infinite number of functions that explain your data perfectly to within rounding error. It would be the infinity of...

1 día ago | 0

Answered

Tilde character underneath a letter in Matlab charts

If you do not need latex then use 'a' followed by U+0330. Unicode can be used for interpreter none or tex

Tilde character underneath a letter in Matlab charts

If you do not need latex then use 'a' followed by U+0330. Unicode can be used for interpreter none or tex

2 días ago | 0

Answered

Create a function that is the sum of an arbitrary number of functions

@(t) sum(cellfun(@(H) H(t), Bi))

Create a function that is the sum of an arbitrary number of functions

@(t) sum(cellfun(@(H) H(t), Bi))

2 días ago | 0

Answered

different version of MATLAB same license server

Yes. Each license server can serve licenses for any older version. Also, each license for a particular version is also valid ...

different version of MATLAB same license server

Yes. Each license server can serve licenses for any older version. Also, each license for a particular version is also valid ...

2 días ago | 0

Answered

implement first kind bessel function

Not exactly. Although -J1 is the derivative of J0, that does not mean that J1 = -besselj(1,x), it means that J1 = besselj(1,x) a...

implement first kind bessel function

Not exactly. Although -J1 is the derivative of J0, that does not mean that J1 = -besselj(1,x), it means that J1 = besselj(1,x) a...

2 días ago | 1

| accepted

Answered

What is the best syntax to use for dVph/dλ?

No, if you are working numerically use gradient() If you are working symbolically then diff(Vph(lambda), lambda)

What is the best syntax to use for dVph/dλ?

No, if you are working numerically use gradient() If you are working symbolically then diff(Vph(lambda), lambda)

2 días ago | 0

Answered

Exported formulas on excel sheets resulted in text which would not be evaluated automatically

That post does not say that the formulas will be executable once written by xlswrite. None of the table based operations such...

Exported formulas on excel sheets resulted in text which would not be evaluated automatically

That post does not say that the formulas will be executable once written by xlswrite. None of the table based operations such...

2 días ago | 0

Answered

Using broadcasting array variable values as indexes

In that code you cannot eliminate the broadcast variables. If the arrays are large then there could potentially be a fair ove...

Using broadcasting array variable values as indexes

In that code you cannot eliminate the broadcast variables. If the arrays are large then there could potentially be a fair ove...

2 días ago | 0

| accepted

Answered

Simulink Fixed Point vs Fixed point toolbox

https://www.mathworks.com/help/simulink/fixed-point.html Simulation with fixed point requires the Fixed Point Designer Toolbo...

Simulink Fixed Point vs Fixed point toolbox

https://www.mathworks.com/help/simulink/fixed-point.html Simulation with fixed point requires the Fixed Point Designer Toolbo...

2 días ago | 0

| accepted

Answered

How can I pass variables to eval without error suppression ?

sprintf('%g', a, b); This will not work for non-numeric variables.

How can I pass variables to eval without error suppression ?

sprintf('%g', a, b); This will not work for non-numeric variables.

2 días ago | 0

Answered

directed diffusion routing algorithm using matlab

Okay, go ahead. Let us know if you encounter any error messages you do not understand.

directed diffusion routing algorithm using matlab

Okay, go ahead. Let us know if you encounter any error messages you do not understand.

2 días ago | 0

| accepted

Answered

How to replace complex numbers in a column vector with 0.000+0.000i ?

Supposing the values are stored in fft_A then fft_A(2:4) = 0; is enough. When you display fft_A afterwards you will see the c...

How to replace complex numbers in a column vector with 0.000+0.000i ?

Supposing the values are stored in fft_A then fft_A(2:4) = 0; is enough. When you display fft_A afterwards you will see the c...

2 días ago | 0

| accepted

Answered

Why is the length of these two variables are different?

You do not truncate ACCN down to length c. ACCN had been 11 long because of the previous iterations; now only 10 are needed but ...

Why is the length of these two variables are different?

You do not truncate ACCN down to length c. ACCN had been 11 long because of the previous iterations; now only 10 are needed but ...

2 días ago | 1

| accepted