Answered

How do I choose 256 or 0 values from my image?

[row, column] = find(BW); See also regionprops() such as PixelIDList

How do I choose 256 or 0 values from my image?

[row, column] = find(BW); See also regionprops() such as PixelIDList

6 days ago | 0

| accepted

Answered

Why is my script not enterering the elseif argument

end % group No, that is incorrect. You have for moNr, within for jo, within for tsk, so that "end" is matching tsk. You do ...

Why is my script not enterering the elseif argument

end % group No, that is incorrect. You have for moNr, within for jo, within for tsk, so that "end" is matching tsk. You do ...

6 days ago | 0

Answered

How to stop a sub function after certain time from main function ?

If you use parfeval() then you can cancel() the future. However when you cancel a future you do not have access to its worksp...

How to stop a sub function after certain time from main function ?

If you use parfeval() then you can cancel() the future. However when you cancel a future you do not have access to its worksp...

6 days ago | 1

Answered

How to use monte carlos method without using rand()

You need *some* source of randomness. It does not have to be truly random. There are websites that you can connect to in orde...

How to use monte carlos method without using rand()

You need *some* source of randomness. It does not have to be truly random. There are websites that you can connect to in orde...

6 days ago | 1

Answered

ERROR ... -------------------------------------- cwt ---> Invalid Value for Scales !

Compare the example_ground_motion.acc file with the ex1.acc and ex2.acc files. The example_ground_motion.acc file starts with ...

ERROR ... -------------------------------------- cwt ---> Invalid Value for Scales !

Compare the example_ground_motion.acc file with the ex1.acc and ex2.acc files. The example_ground_motion.acc file starts with ...

6 days ago | 0

Answered

Assign identification number to image

You are asking for the wrong thing. What you need to do is create a matrix the same size as your image, in which each location i...

Assign identification number to image

You are asking for the wrong thing. What you need to do is create a matrix the same size as your image, in which each location i...

7 days ago | 0

Answered

can we apply newton divided difference interpolation method for tumor detection

As previously discussed, the answer is Yes, it can be done, but that the result is likely to be numeric garbage. No-one can p...

can we apply newton divided difference interpolation method for tumor detection

As previously discussed, the answer is Yes, it can be done, but that the result is likely to be numeric garbage. No-one can p...

7 days ago | 0

Answered

I try to write simple analytical function Gomez and Levy with ga in optimization toolbox but it cannot run

y=(4*x1.^2)-2.1*x1.^4+1/3*x1.^6+(x1*x2)-4*x.^2+4*x2.^4; Notice that you have 4*x.^2 . But x is a vector so that would retu...

I try to write simple analytical function Gomez and Levy with ga in optimization toolbox but it cannot run

y=(4*x1.^2)-2.1*x1.^4+1/3*x1.^6+(x1*x2)-4*x.^2+4*x2.^4; Notice that you have 4*x.^2 . But x is a vector so that would retu...

7 days ago | 0

Answered

GUI transpose code encounter some errors

load db; Avoid using that form of load(). Instead, use load as a function assigning to a variable old = load('db.mat')...

GUI transpose code encounter some errors

load db; Avoid using that form of load(). Instead, use load as a function assigning to a variable old = load('db.mat')...

7 days ago | 0

| accepted

Answered

How to in put this on MATLAB

In the places that have the +/-, write one copy of the expression using the + and any other copy using - and multiply the two to...

How to in put this on MATLAB

In the places that have the +/-, write one copy of the expression using the + and any other copy using - and multiply the two to...

7 days ago | 0

Answered

How to remove duplicate x-values and rearrange the y-values?

g = findgroups(x) Col = splitapply(@(Y) {Y}, y, g) ;

How to remove duplicate x-values and rearrange the y-values?

g = findgroups(x) Col = splitapply(@(Y) {Y}, y, g) ;

8 days ago | 0

Answered

Is there a way to easily capture subplots in an app?

When you use plotting commands without passing in the parent container, they use gca() or gcf() as appropriate. gca() uses gcf()...

Is there a way to easily capture subplots in an app?

When you use plotting commands without passing in the parent container, they use gca() or gcf() as appropriate. gca() uses gcf()...

8 days ago | 0

Answered

Speed up the optimization toolbox problem

No, there are no easier ways. There are some ways that might improve performance even more than using rapid acceleration, but...

Speed up the optimization toolbox problem

No, there are no easier ways. There are some ways that might improve performance even more than using rapid acceleration, but...

8 days ago | 0

Answered

How to get a one function result?

You can create a helper function function varargout = safe(fcn, varargin) try [varargout{}] = fcn(varargin{:})...

How to get a one function result?

You can create a helper function function varargout = safe(fcn, varargin) try [varargout{}] = fcn(varargin{:})...

8 days ago | 0

| accepted

Answered

I have to do a parallel simulation without a parallel simulation tool box? The main idea is to Remove a for loop that does one iteration after another to speed up computation.

You have a small number of possibilities: * upgrade to a version that supports background pools * obtain the parallel comput...

I have to do a parallel simulation without a parallel simulation tool box? The main idea is to Remove a for loop that does one iteration after another to speed up computation.

You have a small number of possibilities: * upgrade to a version that supports background pools * obtain the parallel comput...

9 days ago | 0

Answered

What should I do if I get an error message called "Execution of script addpoints as a function is not supported"?

Inside of your function, your global variable p is not class AnimatedLine The most common cause would be that in the place yo...

What should I do if I get an error message called "Execution of script addpoints as a function is not supported"?

Inside of your function, your global variable p is not class AnimatedLine The most common cause would be that in the place yo...

9 days ago | 1

Answered

How do you make it so that the simplify function displays the correct answer?

(s^2 - 20*s + 200) The roots of that are 10 +/- 10i . So that expression is already fully factorized to real coefficients, ...

How do you make it so that the simplify function displays the correct answer?

(s^2 - 20*s + 200) The roots of that are 10 +/- 10i . So that expression is already fully factorized to real coefficients, ...

9 days ago | 0

Answered

How to make numbers(coefficients of a polynomial) in the plot legend decimal while they are automatically fraction

dig = 4; fplot( vpa( poly2sym( coefficientmatrixflipped(z, :), dig), [0 5])

How to make numbers(coefficients of a polynomial) in the plot legend decimal while they are automatically fraction

dig = 4; fplot( vpa( poly2sym( coefficientmatrixflipped(z, :), dig), [0 5])

9 days ago | 0

| accepted

Answered

Appending Values to an Empty Array

size() always returns a vector. Consider numel()

Appending Values to an Empty Array

size() always returns a vector. Consider numel()

10 days ago | 0

Answered

Append indices to vector from container map

That cannot be done in MATLAB under the restrictions you put on. containers.map does not offer any operations that affect all...

Append indices to vector from container map

That cannot be done in MATLAB under the restrictions you put on. containers.map does not offer any operations that affect all...

10 days ago | 1

| accepted

Answered

Input and Output Arguments

If you were to use a non-anonymous function to do that, then the function would have to use evalin('caller') and assignin('calle...

Input and Output Arguments

If you were to use a non-anonymous function to do that, then the function would have to use evalin('caller') and assignin('calle...

10 days ago | 0

Answered

How to plot a dot on a function line with only 1 value

plot(x, y, '-', 0, 4, 'bo')

How to plot a dot on a function line with only 1 value

plot(x, y, '-', 0, 4, 'bo')

10 days ago | 0

Answered

solving a system of equation using symbolic expressions returns empty solution

syms CG0 HC R T K0 Cm0 beta syms RH q_H2O CG K Cm HK eq1 = q_H2O == Cm * CG*K*RH / ((1-K*RH)*(1+(CG-1)*K*RH)); eq2 = C...

solving a system of equation using symbolic expressions returns empty solution

syms CG0 HC R T K0 Cm0 beta syms RH q_H2O CG K Cm HK eq1 = q_H2O == Cm * CG*K*RH / ((1-K*RH)*(1+(CG-1)*K*RH)); eq2 = C...

10 days ago | 0

| accepted

Answered

In spite of being real, I get the error: Warning: Imaginary parts of complex X and/or Y arguments ignored.

dNis = Nis - Nth; Ais = sqrt((AInj^2 - gammaN/gammaP*dNis)/(1 + g*dNis/gammaP)); dNis is negative. That makes the numerator f...

In spite of being real, I get the error: Warning: Imaginary parts of complex X and/or Y arguments ignored.

dNis = Nis - Nth; Ais = sqrt((AInj^2 - gammaN/gammaP*dNis)/(1 + g*dNis/gammaP)); dNis is negative. That makes the numerator f...

10 days ago | 0

Answered

hey guys , just started working with ROS and MATLAB for Msc .I am trying to access laser scannerdata from ros But keep getting the following error. Could somebody help me

You have to use Ranges not ranges.

hey guys , just started working with ROS and MATLAB for Msc .I am trying to access laser scannerdata from ros But keep getting the following error. Could somebody help me

You have to use Ranges not ranges.

10 days ago | 0

| accepted

Answered

Error using symengine, Too many input arguments, x= xf; fx = funfcn(x,varargin{:});

with those constants, f_sym is (y*y + y + 1)/(y*y+y+1) which is 1 except at 0. derivative of 1 is 0... with no symbolic variable...

Error using symengine, Too many input arguments, x= xf; fx = funfcn(x,varargin{:});

with those constants, f_sym is (y*y + y + 1)/(y*y+y+1) which is 1 except at 0. derivative of 1 is 0... with no symbolic variable...

10 days ago | 1

| accepted

Answered

How to avoid error in anonymous function

f = @(x, u) Fx(x,u)*x(t-1) + Fu(x,u)*u(t-1);

How to avoid error in anonymous function

f = @(x, u) Fx(x,u)*x(t-1) + Fu(x,u)*u(t-1);

10 days ago | 0

Answered

Continuous Errors Trying to Solve for an 11-State Variable w/ ODE45

-(-1200*diff(a1*sin(omega1*t)) omega1 is a scalar constant. At any instant in an ode45() call, t is a scalar value. omega1*t is...

Continuous Errors Trying to Solve for an 11-State Variable w/ ODE45

-(-1200*diff(a1*sin(omega1*t)) omega1 is a scalar constant. At any instant in an ode45() call, t is a scalar value. omega1*t is...

10 days ago | 0

Answered

Why does my plot go blank when I run my program?

for i=1:length(theta2(i)) At the point in your code where you are constructing the bounds of the for loop, the bounds to the ri...

Why does my plot go blank when I run my program?

for i=1:length(theta2(i)) At the point in your code where you are constructing the bounds of the for loop, the bounds to the ri...

10 days ago | 0