Answered

How to see if characters are present in a string array.

You could use multiple contains() tests. But I suggest that instead you do something like ismember(sort(char(InputSeq)), cell...

How to see if characters are present in a string array.

You could use multiple contains() tests. But I suggest that instead you do something like ismember(sort(char(InputSeq)), cell...

4 days ago | 0

Answered

I had a problem with the following code. The error says that there are "too many input arguments". I know that the problem is from the fsolve equation but I can't to solve it.

theta34(:,i) = fsolve(@position, [1 1],options,th)*180/pi; That th after the options struct will be interpreted according to a ...

I had a problem with the following code. The error says that there are "too many input arguments". I know that the problem is from the fsolve equation but I can't to solve it.

theta34(:,i) = fsolve(@position, [1 1],options,th)*180/pi; That th after the options struct will be interpreted according to a ...

4 days ago | 0

Answered

How to avoid introducing abs( ) when simplifying expressions using the symbolic toolbox ?

%% Problem 6.4 syms x y x_dot y_dot assume(x,'real'); assume(y, 'real'); assume(x_dot, 'real'); assume(y_dot, 'real'); %...

How to avoid introducing abs( ) when simplifying expressions using the symbolic toolbox ?

%% Problem 6.4 syms x y x_dot y_dot assume(x,'real'); assume(y, 'real'); assume(x_dot, 'real'); assume(y_dot, 'real'); %...

5 days ago | 0

Answered

Can my x-axis have varying scales for certain ranges of values?

Is it possible to scale my x-axis so the intervals are spread further apart from each other for more time-sensitive data and clo...

Can my x-axis have varying scales for certain ranges of values?

Is it possible to scale my x-axis so the intervals are spread further apart from each other for more time-sensitive data and clo...

5 days ago | 0

| accepted

Answered

Trying to create neural network but getting a NaN error from dataset

net = trainNetwork(train_X1, string(Y1), layers, options); However: Error using trainNetwork (line 184) The training sequence...

Trying to create neural network but getting a NaN error from dataset

net = trainNetwork(train_X1, string(Y1), layers, options); However: Error using trainNetwork (line 184) The training sequence...

5 days ago | 0

| accepted

Answered

Why won't my plot graph a line?

A for loop assigns the loop control variable each column of the expression in turn. After the loop it has the last value it was ...

Why won't my plot graph a line?

A for loop assigns the loop control variable each column of the expression in turn. After the loop it has the last value it was ...

5 days ago | 0

Answered

I need to loop this operation and store them in a matrix

stainless_steel() function stainless_steel(~,~,~) T_i = [0 0 12.5 25 37.5 50 0]; k = 0.0162; cp = 0.5; ...

I need to loop this operation and store them in a matrix

stainless_steel() function stainless_steel(~,~,~) T_i = [0 0 12.5 25 37.5 50 0]; k = 0.0162; cp = 0.5; ...

5 days ago | 1

Answered

Integral a function handle of two variables with respect to a variable

f = @(x, y) x+y; g = @(x) integral(@(y) f(x,y), 0, 1, 'arrayvalued', true) t = (0:0.1:1); g(t)

Integral a function handle of two variables with respect to a variable

f = @(x, y) x+y; g = @(x) integral(@(y) f(x,y), 0, 1, 'arrayvalued', true) t = (0:0.1:1); g(t)

5 days ago | 1

| accepted

Answered

I have a .csv file with a list of numbers, what code can I use to check if an inputted number exists in that file.

readtable(). ismember() the appropriate column of the table.

I have a .csv file with a list of numbers, what code can I use to check if an inputted number exists in that file.

readtable(). ismember() the appropriate column of the table.

5 days ago | 0

Answered

Creating a plot that changes colour as the month changes

https://www.mathworks.com/matlabcentral/fileexchange/19476-colored-line-or-scatter-plot https://www.mathworks.com/matlabcentra...

Creating a plot that changes colour as the month changes

https://www.mathworks.com/matlabcentral/fileexchange/19476-colored-line-or-scatter-plot https://www.mathworks.com/matlabcentra...

5 days ago | 0

Answered

Open to feedback of working code (please review)

if abs(error)<=tol, break;end That only breaks out of one level of for loop. Suppose you get convergence at i = 2, j =...

Open to feedback of working code (please review)

if abs(error)<=tol, break;end That only breaks out of one level of for loop. Suppose you get convergence at i = 2, j =...

5 days ago | 0

| accepted

Answered

Pcolor Error: Matrix Dimensions Must Agree

pcolor takes x then y. x corresponds to columns. You have 13 columns so your x needs to be length 13

Pcolor Error: Matrix Dimensions Must Agree

pcolor takes x then y. x corresponds to columns. You have 13 columns so your x needs to be length 13

5 days ago | 0

Answered

Error: Dot indexing is not supported for variables of this type.

Feature_Learner = net.Layers(175).Name That already includes the Name component, but in the next line you try to take the Nam...

Error: Dot indexing is not supported for variables of this type.

Feature_Learner = net.Layers(175).Name That already includes the Name component, but in the next line you try to take the Nam...

5 days ago | 0

| accepted

Answered

How to make imshow function faster in the for loop?

To make imshow() faster... Don't call imshow() Seriously: imshow() has a lot of overhead. Instead, call image() once and reco...

How to make imshow function faster in the for loop?

To make imshow() faster... Don't call imshow() Seriously: imshow() has a lot of overhead. Instead, call image() once and reco...

5 days ago | 1

Answered

Unable to convert expression into double array, in Gamultiobj

Use matlabFunction() to convert yy to a numeric function. Be sure to use the 'vars' option to bundle all of the inputs into a si...

Unable to convert expression into double array, in Gamultiobj

Use matlabFunction() to convert yy to a numeric function. Be sure to use the 'vars' option to bundle all of the inputs into a si...

6 days ago | 0

| accepted

Answered

Optimization problem with lower and upper bounded constraints

clc; clear x = optimvar('x',10,'UpperBound',[2000;16000;120;5000;2000;93;95;12;4;162],"LowerBound",[0;0;0;0;0;85;90;3;0.01;145]...

Optimization problem with lower and upper bounded constraints

clc; clear x = optimvar('x',10,'UpperBound',[2000;16000;120;5000;2000;93;95;12;4;162],"LowerBound",[0;0;0;0;0;85;90;3;0.01;145]...

6 days ago | 0

| accepted

Answered

Conditional addition of matrix rows?

https://www.mathworks.com/help/matlab/ref/movsum.html#namevaluepairarguments movsum() with 'Endpoints', 'shrink'

Conditional addition of matrix rows?

https://www.mathworks.com/help/matlab/ref/movsum.html#namevaluepairarguments movsum() with 'Endpoints', 'shrink'

6 days ago | 0

Answered

diff function can not be used for a timeseries variable ver 2019b

That code is not expecting a timeseries object to be passed in: it is expecting a vector of times as the first parameter, and a ...

diff function can not be used for a timeseries variable ver 2019b

That code is not expecting a timeseries object to be passed in: it is expecting a vector of times as the first parameter, and a ...

6 days ago | 0

Answered

Genetic Algorithm functions unrecognized

After line 201 nueva2=nueva1; there should be an end statement before the next line function [nueva]= selection(poblaci...

Genetic Algorithm functions unrecognized

After line 201 nueva2=nueva1; there should be an end statement before the next line function [nueva]= selection(poblaci...

6 days ago | 0

Answered

Numeric column not read as string with readtable on XLS file

Excel stores "general numbers" in .xls files as binary floating point ("XNUM"), not as text. You can open the spreadsheet and ...

Numeric column not read as string with readtable on XLS file

Excel stores "general numbers" in .xls files as binary floating point ("XNUM"), not as text. You can open the spreadsheet and ...

6 days ago | 0

Answered

I want help in writing a matlab code so that I wouldn't have to manually input the various steps as I have shown below. Thanks

Unfortunately, someone who was not familiar with the field would have little idea what is going on. What is K -- is that spring ...

I want help in writing a matlab code so that I wouldn't have to manually input the various steps as I have shown below. Thanks

Unfortunately, someone who was not familiar with the field would have little idea what is going on. What is K -- is that spring ...

6 days ago | 0

Answered

Storing small numbers and logarithms.

Depending on your range of values and your accuracy needs, you could try a double taylor approximation. syms a b positive E = ...

Storing small numbers and logarithms.

Depending on your range of values and your accuracy needs, you could try a double taylor approximation. syms a b positive E = ...

6 days ago | 1

Answered

Insert blank cells in a matrix

You cannot do that. Numeric matrices cannot have spaces in them. You can convert the matrix into a cell array and put spaces in...

Insert blank cells in a matrix

You cannot do that. Numeric matrices cannot have spaces in them. You can convert the matrix into a cell array and put spaces in...

6 days ago | 0

| accepted

Answered

How to read image one by one from folder and make prediction save it in CSV format

net = load('11ClassesResnet.mat') net=net.trainednet inputSize = net.Layers(1).InputSize; path_directory='C...

How to read image one by one from folder and make prediction save it in CSV format

net = load('11ClassesResnet.mat') net=net.trainednet inputSize = net.Layers(1).InputSize; path_directory='C...

6 days ago | 0

Answered

How to display "serial device connected" or "not connected"?

serialportlist('available') can tell you whether the port of interest is "available" serialport() objects appear to try to open...

How to display "serial device connected" or "not connected"?

serialportlist('available') can tell you whether the port of interest is "available" serialport() objects appear to try to open...

6 days ago | 0

| accepted

Answered

Unspecified behaviour of function imag.

This will not affect your code. You are encountering Command/Function Duality https://www.mathworks.com/help/matlab/matlab_prog...

Unspecified behaviour of function imag.

This will not affect your code. You are encountering Command/Function Duality https://www.mathworks.com/help/matlab/matlab_prog...

6 days ago | 0

| accepted

Answered

How to solve this error when I use fmincon?

if (M(end) >= (Trigger * N)) && ~alreadyCalled % triggering level % Calling for the very first time if we ...

How to solve this error when I use fmincon?

if (M(end) >= (Trigger * N)) && ~alreadyCalled % triggering level % Calling for the very first time if we ...

6 days ago | 0

| accepted

Answered

why The name 'Parent' is not an accessible property for an instance of class 'matlab.graphics.GraphicsPlaceholder'?

Put a breakpoint in at the begining of the sequence of statements where h() is assigned to, the series h(1) = surface(x,y,z,'Fa...

why The name 'Parent' is not an accessible property for an instance of class 'matlab.graphics.GraphicsPlaceholder'?

Put a breakpoint in at the begining of the sequence of statements where h() is assigned to, the series h(1) = surface(x,y,z,'Fa...

6 days ago | 0

| accepted

Answered

Variable change should not affect during loop execution?

Function for variable = 1 : number_of_iterations original_a = a; original_b = b; if (condition) ...

Variable change should not affect during loop execution?

Function for variable = 1 : number_of_iterations original_a = a; original_b = b; if (condition) ...

6 days ago | 0