Answered

Undefined function 'sqrt' for input arguments of type 'char'.

cwt(bigcircle_ant2_data,'amor',1); %produce plot-morlet You are using the calling syntax for newer versions of cwt...

Undefined function 'sqrt' for input arguments of type 'char'.

cwt(bigcircle_ant2_data,'amor',1); %produce plot-morlet You are using the calling syntax for newer versions of cwt...

2 days ago | 0

Answered

C = union( A,B ) is too slow. Is there any faster way given that A and B are ordered.

The faster way would involve writing some mex code. There is an undocumented internal binary search routine, but calling it repe...

C = union( A,B ) is too slow. Is there any faster way given that A and B are ordered.

The faster way would involve writing some mex code. There is an undocumented internal binary search routine, but calling it repe...

2 days ago | 0

Answered

What type of error is this?

You accidentally save()'d variables on top of a code file. The code is gone. But you might be able to get something useful fr...

What type of error is this?

You accidentally save()'d variables on top of a code file. The code is gone. But you might be able to get something useful fr...

2 days ago | 0

| accepted

Answered

Function implementation matlab language

https://www.mathworks.com/matlabcentral/answers/576745-shifting-handling-in-matlab-with-for-loop#answer_476968

Function implementation matlab language

https://www.mathworks.com/matlabcentral/answers/576745-shifting-handling-in-matlab-with-for-loop#answer_476968

2 days ago | 0

Answered

Can I run eigs on a GPU?

eigs really is not supported. https://www.mathworks.com/matlabcentral/answers/572377-accelerate-eigs-with-gpu#answer_472900

Can I run eigs on a GPU?

eigs really is not supported. https://www.mathworks.com/matlabcentral/answers/572377-accelerate-eigs-with-gpu#answer_472900

2 days ago | 1

Answered

C code generation symbols not found linker error

https://www.mathworks.com/help/images/ref/imadjust.html#bvm6s9t-1 imadjust generates code that depends upon a shared library t...

C code generation symbols not found linker error

https://www.mathworks.com/help/images/ref/imadjust.html#bvm6s9t-1 imadjust generates code that depends upon a shared library t...

3 days ago | 0

Answered

calculating error while averaging multiple images

Do you want the average of the R, G, and B separately for each image? Are you asking for averages to be taken over time for ea...

calculating error while averaging multiple images

Do you want the average of the R, G, and B separately for each image? Are you asking for averages to be taken over time for ea...

3 days ago | 0

Answered

Is there a way to get the max memory used when I run my script?

https://www.mathworks.com/matlabcentral/answers/214247-allocated-freed-self-memory-and-peak-memory-in-profiler

Is there a way to get the max memory used when I run my script?

https://www.mathworks.com/matlabcentral/answers/214247-allocated-freed-self-memory-and-peak-memory-in-profiler

3 days ago | 0

Answered

how to use datetime(datestr)

Do not try to mix serial data numbers and datetime objects. You can skip most of your problems. t = readtable('data.xlsx'); T...

how to use datetime(datestr)

Do not try to mix serial data numbers and datetime objects. You can skip most of your problems. t = readtable('data.xlsx'); T...

3 days ago | 0

Answered

ode45 does not solve my second order problem

This has exactly the same problem as before. Your left hand side involves z as a function of x, but your right hand side invol...

ode45 does not solve my second order problem

This has exactly the same problem as before. Your left hand side involves z as a function of x, but your right hand side invol...

3 days ago | 1

Answered

Line Breaks in command window

disp("SPACING"+newline+newline+"CODE") fprintf("SPACING\n\nCODE\n") disp("SPACING");fprintf('\n'); disp("CODE") disp("S...

Line Breaks in command window

disp("SPACING"+newline+newline+"CODE") fprintf("SPACING\n\nCODE\n") disp("SPACING");fprintf('\n'); disp("CODE") disp("S...

3 days ago | 0

| accepted

Answered

Error read data from HYCOM

Your url has an extra space at the beginning and the end. I deleted them and tried and had no problem.

Error read data from HYCOM

Your url has an extra space at the beginning and the end. I deleted them and tried and had no problem.

3 days ago | 0

Answered

How to select a sub square matrix, from a matrix; given the size of the sub square matrix and middle element

use find() with two output arguments to get the row and column of the center. Then use indexing like row-something:row+something...

How to select a sub square matrix, from a matrix; given the size of the sub square matrix and middle element

use find() with two output arguments to get the row and column of the center. Then use indexing like row-something:row+something...

3 days ago | 0

| accepted

Answered

How to calculate flotating point

Supposing that the data is stored in F, then char(compose("%.2f %+.2f", round(real(F),2), round(imag(F),2))) This will produce...

How to calculate flotating point

Supposing that the data is stored in F, then char(compose("%.2f %+.2f", round(real(F),2), round(imag(F),2))) This will produce...

3 days ago | 0

Answered

How to make a a certain range with different color in colorbar

https://www.mathworks.com/matlabcentral/fileexchange/69470-custom-colormap The above function requires that the positions be d...

How to make a a certain range with different color in colorbar

https://www.mathworks.com/matlabcentral/fileexchange/69470-custom-colormap The above function requires that the positions be d...

3 days ago | 1

Answered

'Error - Array indices must be positive integers or logical values

t1 = 0; t2 = 0.04; So t2-t1 is 0.04 - 0 = 0.04 x_2 = v_x1(t2-t1)+x_1 That code attempts to index v_x1 at location t2-t1 whic...

'Error - Array indices must be positive integers or logical values

t1 = 0; t2 = 0.04; So t2-t1 is 0.04 - 0 = 0.04 x_2 = v_x1(t2-t1)+x_1 That code attempts to index v_x1 at location t2-t1 whic...

3 days ago | 0

| accepted

Answered

How to load library without using mingw64 complier?

See https://www.mathworks.com/matlabcentral/answers/100470-how-do-i-use-loadlibrary-in-a-deployed-program-generated-from-matlab-...

How to load library without using mingw64 complier?

See https://www.mathworks.com/matlabcentral/answers/100470-how-do-i-use-loadlibrary-in-a-deployed-program-generated-from-matlab-...

3 days ago | 0

| accepted

Answered

Explaination on solving trigonmetric equations for theta.

There are not really two solutions for each theta variable: there are two families of solutions, with the other solutions being ...

Explaination on solving trigonmetric equations for theta.

There are not really two solutions for each theta variable: there are two families of solutions, with the other solutions being ...

3 days ago | 0

| accepted

Answered

How do I shift columns (left or right) in a matrix

shift = abs(diff) %left data = [data(:, shift+1:end), zeros(size(data,1),shift)] %right data = [zeros(size(data,1),shift), d...

How do I shift columns (left or right) in a matrix

shift = abs(diff) %left data = [data(:, shift+1:end), zeros(size(data,1),shift)] %right data = [zeros(size(data,1),shift), d...

3 days ago | 0

| accepted

Answered

ODE with input a symbolic matrix

If you syms t syms X [1 12] and then apply the body of your function, then Sxd will come out as a 2 x 6 array. However, the o...

ODE with input a symbolic matrix

If you syms t syms X [1 12] and then apply the body of your function, then Sxd will come out as a 2 x 6 array. However, the o...

3 days ago | 0

Answered

Making a GUI in MATLAB with Drop Down

Generally speaking, when you create a GUI, you have multiple phases: Code that creates the GUI elements and sets all required C...

Making a GUI in MATLAB with Drop Down

Generally speaking, when you create a GUI, you have multiple phases: Code that creates the GUI elements and sets all required C...

3 days ago | 0

Answered

Exceptions for using global variables in parfor loops

Is it possible to force Matlab to allow this use? NO If not, is there already a patch allowing it or can it be foresee in a ne...

Exceptions for using global variables in parfor loops

Is it possible to force Matlab to allow this use? NO If not, is there already a patch allowing it or can it be foresee in a ne...

3 days ago | 0

| accepted

Answered

Array indices must be positive integers or logical values. Error in sym/subsref (line 870)

syms x fx_given=input('Input the desired function:'); We can predict from the error message that whatever the user is entering...

Array indices must be positive integers or logical values. Error in sym/subsref (line 870)

syms x fx_given=input('Input the desired function:'); We can predict from the error message that whatever the user is entering...

3 days ago | 0

| accepted

Answered

Correct use of isempty

clc prompt = 'Convert Degree to Radients or Radient to Degree?'; option = input(prompt, 's') switch option case 'DR' ...

Correct use of isempty

clc prompt = 'Convert Degree to Radients or Radient to Degree?'; option = input(prompt, 's') switch option case 'DR' ...

3 days ago | 1

Answered

shifting handling in matlab with for loop

function crcReg = calcCRC(crcData, crcReg, CRC16_POLY) for i = 0 : 7 if bitxor( bitshift( bitand(crcReg, 0x8000), ...

shifting handling in matlab with for loop

function crcReg = calcCRC(crcData, crcReg, CRC16_POLY) for i = 0 : 7 if bitxor( bitshift( bitand(crcReg, 0x8000), ...

3 days ago | 0

Answered

Help with FOR to PARFOR conversion

Every iteration you overwrite all of D. Your result is whatever was assigned in the last iteration. But the order of iterations ...

Help with FOR to PARFOR conversion

Every iteration you overwrite all of D. Your result is whatever was assigned in the last iteration. But the order of iterations ...

4 days ago | 0

Answered

Error using sym/subsindex

symbolic variables can never be used as indices. You cannot symsum or symprod and use the control variable as an index. Inste...

Error using sym/subsindex

symbolic variables can never be used as indices. You cannot symsum or symprod and use the control variable as an index. Inste...

4 days ago | 0

| accepted

Answered

Make a point move up and down

x = 0:.01:20; %linspace of x y = sin(x); %wave equation px = 0; %initial x plot py = 0; %initial y plot img =imread('AvgBsc...

Make a point move up and down

x = 0:.01:20; %linspace of x y = sin(x); %wave equation px = 0; %initial x plot py = 0; %initial y plot img =imread('AvgBsc...

4 days ago | 0

| accepted

Answered

How to generate random numbers with constraints and different boundaries (for a high dimension)?

https://www.mathworks.com/matlabcentral/fileexchange/9700-random-vectors-with-fixed-sum Roger has programmed exactly that.

How to generate random numbers with constraints and different boundaries (for a high dimension)?

https://www.mathworks.com/matlabcentral/fileexchange/9700-random-vectors-with-fixed-sum Roger has programmed exactly that.

4 days ago | 0

Answered

if statement not displaying

if (n) >= (3) You are entering 3 ingredients, so n >= 3 is true, so the body of the "if" will be executed. elseif (a(k)) == (1...

if statement not displaying

if (n) >= (3) You are entering 3 ingredients, so n >= 3 is true, so the body of the "if" will be executed. elseif (a(k)) == (1...

4 days ago | 0

| accepted