Answered

How to solve this error presented when compiling .cpp files to mex?

const int *dim1 = mxGetDimensions(prhs[0]); mxGetDimensions does not return int* https://www.mathworks.com/help/matlab/api...

How to solve this error presented when compiling .cpp files to mex?

const int *dim1 = mxGetDimensions(prhs[0]); mxGetDimensions does not return int* https://www.mathworks.com/help/matlab/api...

circa 2 ore ago | 0

Answered

How can i make a 1 count as 11 if its best in blackjack

if score <= 11 && ismember(1, hand)

How can i make a 1 count as 11 if its best in blackjack

if score <= 11 && ismember(1, hand)

circa 9 ore ago | 0

| accepted

Answered

How I can Solve an Advanced Cubic Equation

syms x a r eqn = x^3*a^2*(r-1)+x^2*a*(a-2*(r-1)) - x*(2*a+1)+1; sol = simplify(solve(eqn, x, 'maxdegree', 3)); The second and...

How I can Solve an Advanced Cubic Equation

syms x a r eqn = x^3*a^2*(r-1)+x^2*a*(a-2*(r-1)) - x*(2*a+1)+1; sol = simplify(solve(eqn, x, 'maxdegree', 3)); The second and...

circa 9 ore ago | 0

Answered

Modifying a message / dialog box in a function for different parts of the function and automatically closing?

https://www.mathworks.com/help/matlab/ref/uialert.html uialert() with 'modal', false should return a handle that you can manipu...

Modifying a message / dialog box in a function for different parts of the function and automatically closing?

https://www.mathworks.com/help/matlab/ref/uialert.html uialert() with 'modal', false should return a handle that you can manipu...

circa 10 ore ago | 0

| accepted

Answered

Generating covariance from matrix

N = 20; y = rand(N,1); autocov = zeros(2, 2, N); for i = 1:N autocov(:, :, i) = cov(y(i:19),y(i+1:20)); end The result...

Generating covariance from matrix

N = 20; y = rand(N,1); autocov = zeros(2, 2, N); for i = 1:N autocov(:, :, i) = cov(y(i:19),y(i+1:20)); end The result...

circa 15 ore ago | 0

| accepted

Answered

How to generate all possible connection with graph theory function

https://www.mathworks.com/matlabcentral/answers/286462-how-to-find-all-possible-paths-from-one-node-to-another-node#answer_223...

How to generate all possible connection with graph theory function

https://www.mathworks.com/matlabcentral/answers/286462-how-to-find-all-possible-paths-from-one-node-to-another-node#answer_223...

circa 15 ore ago | 0

Answered

Not enough input arguments

You cannot run that code by simply pressing the green Run button to run it. You must go down to the command line and invoke the ...

Not enough input arguments

You cannot run that code by simply pressing the green Run button to run it. You must go down to the command line and invoke the ...

circa 15 ore ago | 0

Answered

Using wcompress in Matlab

'haar' is not one of the valid compression methods for wcompress() https://www.mathworks.com/help/wavelet/ref/wcompress.html#f1...

Using wcompress in Matlab

'haar' is not one of the valid compression methods for wcompress() https://www.mathworks.com/help/wavelet/ref/wcompress.html#f1...

circa 15 ore ago | 0

| accepted

Answered

how to plot array ? i am using display instruction but i m not able to plot that data on xy plane

pf_n = 0.35:0.05:0.5; ac = (10000.0:10000.0:50000.0).'; C = (1.11 .* Bavg .* ac .* Kw .* pf_n); vs = vr./(1-s); L_W = Q./(...

how to plot array ? i am using display instruction but i m not able to plot that data on xy plane

pf_n = 0.35:0.05:0.5; ac = (10000.0:10000.0:50000.0).'; C = (1.11 .* Bavg .* ac .* Kw .* pf_n); vs = vr./(1-s); L_W = Q./(...

circa 16 ore ago | 0

| accepted

Answered

How to extract a coefficient from a specific symbolic variable?

Sometimes you can isolate() the variable in the equation, after which coeffs() the lhs() of the equation. Otherwise, lhs(eqn)-r...

How to extract a coefficient from a specific symbolic variable?

Sometimes you can isolate() the variable in the equation, after which coeffs() the lhs() of the equation. Otherwise, lhs(eqn)-r...

circa 16 ore ago | 0

Answered

Errors using function and fsolve

The function you are trying to find the zero of, must return a scalar. Your formula involves surr.h which is a vector, so your f...

Errors using function and fsolve

The function you are trying to find the zero of, must return a scalar. Your formula involves surr.h which is a vector, so your f...

circa 17 ore ago | 0

Answered

Is the function "minimize " included in MatLAB ?

No it is not included. You can get it from http://www.cs.toronto.edu/~hinton/MatlabForSciencePaper.html

Is the function "minimize " included in MatLAB ?

No it is not included. You can get it from http://www.cs.toronto.edu/~hinton/MatlabForSciencePaper.html

circa 18 ore ago | 0

Answered

Surface integral calculation over a segment defined by two points

Xq=linspace x1 to x2 and Yq=linspace y1 to y2, using the same number of steps. Now use those as the query locations in an interp...

Surface integral calculation over a segment defined by two points

Xq=linspace x1 to x2 and Yq=linspace y1 to y2, using the same number of steps. Now use those as the query locations in an interp...

circa 20 ore ago | 0

Answered

Check number of windows prompt open

Use .Net to start the processes. https://www.mathworks.com/matlabcentral/answers/497886-finding-pid-of-external-process-called-f...

Check number of windows prompt open

Use .Net to start the processes. https://www.mathworks.com/matlabcentral/answers/497886-finding-pid-of-external-process-called-f...

circa 20 ore ago | 0

Answered

cubic equation solution simple and fast way?

If you have numeric coefficients, use roots()

cubic equation solution simple and fast way?

If you have numeric coefficients, use roots()

circa 20 ore ago | 0

| accepted

Answered

I did plot(x,y) with a set of data that is not in oder, and now my line plot looks terribly wrong. How can I fix this?

Before doing any processing, sortrows data based on column 2. https://www.mathworks.com/help/matlab/ref/double.sortrows.html

I did plot(x,y) with a set of data that is not in oder, and now my line plot looks terribly wrong. How can I fix this?

Before doing any processing, sortrows data based on column 2. https://www.mathworks.com/help/matlab/ref/double.sortrows.html

circa 20 ore ago | 0

Answered

Choose random element of vector

P1 = randi(length(Vector) - 1); P2 = randi([P1+1,length(Vector)]) ; x1 = Vector(P1) ; x2 = Vector(P2) ; Note that ...

Choose random element of vector

P1 = randi(length(Vector) - 1); P2 = randi([P1+1,length(Vector)]) ; x1 = Vector(P1) ; x2 = Vector(P2) ; Note that ...

circa 20 ore ago | 2

Answered

Subtract elements greater than a threshold?

mask = YourArray > 2^19 - 1; YourArray(mask) = YourArray(mask) - 2^20;

Subtract elements greater than a threshold?

mask = YourArray > 2^19 - 1; YourArray(mask) = YourArray(mask) - 2^20;

circa 22 ore ago | 0

| accepted

Answered

Corresponding vector values to array values

Vector = [1 31 11 40 34 46 19 25 24 0 0]; nodes = Vector(Vector ~= 0); total = sum(Matrix(sub2ind(size(Matrix), no...

Corresponding vector values to array values

Vector = [1 31 11 40 34 46 19 25 24 0 0]; nodes = Vector(Vector ~= 0); total = sum(Matrix(sub2ind(size(Matrix), no...

circa 22 ore ago | 1

Answered

Index in position 4 exceeds array bounds (must not exceed 1).

You define Ex(i,j,n,1) = 150; % but we have no reason to expect that on the line M11(i,j,n,g) = (1/(4*dt))*(g1+g2...

Index in position 4 exceeds array bounds (must not exceed 1).

You define Ex(i,j,n,1) = 150; % but we have no reason to expect that on the line M11(i,j,n,g) = (1/(4*dt))*(g1+g2...

circa 22 ore ago | 0

Answered

How to Export Contour Plot as Shape File if Output is of Data Type 'Double'?

https://www.mathworks.com/matlabcentral/answers/358316-how-can-i-export-a-matlab-contour-as-a-polygon-shapefile

How to Export Contour Plot as Shape File if Output is of Data Type 'Double'?

https://www.mathworks.com/matlabcentral/answers/358316-how-can-i-export-a-matlab-contour-as-a-polygon-shapefile

1 giorno ago | 1

Answered

is there something similar to imregistrer but for video?

"Are there functions similar to Imregster but for videos?" No. "Or do I have to save the files as individual frames and go...

is there something similar to imregistrer but for video?

"Are there functions similar to Imregster but for videos?" No. "Or do I have to save the files as individual frames and go...

1 giorno ago | 0

Answered

HOW TO DELETE A LINE FROM A CREATING FILE

writetable(T(2:end, :),'file.csv') This assumes that you want to write out the variable names but skip the first row of the...

HOW TO DELETE A LINE FROM A CREATING FILE

writetable(T(2:end, :),'file.csv') This assumes that you want to write out the variable names but skip the first row of the...

1 giorno ago | 1

| accepted

Answered

i want to sum each row of a matrix to the next row of the same matrix and save it in a new variable. its a part of big algorithm.

cumsum(A, 1)

i want to sum each row of a matrix to the next row of the same matrix and save it in a new variable. its a part of big algorithm.

cumsum(A, 1)

1 giorno ago | 0

Answered

Undefined function 'diff' for input arguments of type 'function_handle'.

There are two major diff() functions in MATLAB. One of them is the numeric difference operator, roughly x(:, 2:end) - x(:, 1...

Undefined function 'diff' for input arguments of type 'function_handle'.

There are two major diff() functions in MATLAB. One of them is the numeric difference operator, roughly x(:, 2:end) - x(:, 1...

1 giorno ago | 0

Answered

Issues defining dot product function

In newer versions of MATLAB, if you use a name as both a function and a variable, then it will treat it as always being a variab...

Issues defining dot product function

In newer versions of MATLAB, if you use a name as both a function and a variable, then it will treat it as always being a variab...

2 giorni ago | 1

Answered

Magnitude, row and column in a Matrix

Use the two output form of min(). The second output will be the appropriate row numbers.

Magnitude, row and column in a Matrix

Use the two output form of min(). The second output will be the appropriate row numbers.

2 giorni ago | 0

Answered

function handle in a loop

Provided that the two calculations return the same size of values, and provided that neither calculation ever returns inf or nan...

function handle in a loop

Provided that the two calculations return the same size of values, and provided that neither calculation ever returns inf or nan...

2 giorni ago | 0

| accepted