Answered

Constrained Global Optimization Problem with MultiStart, GA and HybridFunction using Parallel Processing whithout Ste

Update your code like this: A=rand(2,2); B=[1 ;0]; n = length (A); Com = B; for x = 1: n-1 Com = [Com, (A ^ (x)) * B]...

Constrained Global Optimization Problem with MultiStart, GA and HybridFunction using Parallel Processing whithout Ste

Update your code like this: A=rand(2,2); B=[1 ;0]; n = length (A); Com = B; for x = 1: n-1 Com = [Com, (A ^ (x)) * B]...

2 days ago | 1

Answered

How can I work on a valuable name with a minus sign in it...?

From this documentation: https://mathworks.com/help/matlab/matlab_prog/variable-names.html "valid variable name starts with a ...

How can I work on a valuable name with a minus sign in it...?

From this documentation: https://mathworks.com/help/matlab/matlab_prog/variable-names.html "valid variable name starts with a ...

3 days ago | 1

| accepted

Answered

I don't get the correct output from my function

When you change from -5 to -10, the absissa of the plots change, yes. But the value of the function does not change. What makes ...

I don't get the correct output from my function

When you change from -5 to -10, the absissa of the plots change, yes. But the value of the function does not change. What makes ...

4 days ago | 0

Answered

How do I get my function to return a numerical value?

The function HW5VJ0 returns a function handle. To get a numerical value, you have to call it with the specified value of x: x =...

How do I get my function to return a numerical value?

The function HW5VJ0 returns a function handle. To get a numerical value, you have to call it with the specified value of x: x =...

4 days ago | 0

| accepted

Answered

How to make a 3D plot of 41x41x41 datapoints

You can have a look here to see different solutions to plot data in 3D: https://mathworks.com/help/matlab/visualize/creating-3-...

How to make a 3D plot of 41x41x41 datapoints

You can have a look here to see different solutions to plot data in 3D: https://mathworks.com/help/matlab/visualize/creating-3-...

16 days ago | 0

Answered

I want to apply bubble sort

bubblesort is defined such that it takes only one input (the table to sort). And you call it with two inputs : A=bubbleSort(A,9...

I want to apply bubble sort

bubblesort is defined such that it takes only one input (the table to sort). And you call it with two inputs : A=bubbleSort(A,9...

1 month ago | 0

| accepted

Answered

Obtaining result from a previous point

Have a look here: https://mathworks.com/help/matlab/matlab_prog/loop-control-statements.html https://mathworks.com/help/matlab...

Obtaining result from a previous point

Have a look here: https://mathworks.com/help/matlab/matlab_prog/loop-control-statements.html https://mathworks.com/help/matlab...

1 month ago | 0

| accepted

Answered

symbolic system of equation

First problems on lines 2 to 4: gamma=sym(zeros(i,1)); w=sym(zeros(i,1)); l=sym(zeros(i,1)); i is not yet defined.

symbolic system of equation

First problems on lines 2 to 4: gamma=sym(zeros(i,1)); w=sym(zeros(i,1)); l=sym(zeros(i,1)); i is not yet defined.

1 month ago | 0

Answered

What is the difference between the fixed point and floating point modeling in simulink ?

Have a look at these documentations : https://mathworks.com/help/comm/ug/floating-point-and-fixed-point-data-types.html https:...

What is the difference between the fixed point and floating point modeling in simulink ?

Have a look at these documentations : https://mathworks.com/help/comm/ug/floating-point-and-fixed-point-data-types.html https:...

2 months ago | 1

Answered

select from matrix!

When executing the command it outputs : b = 3 2 2 1 The command : b= [a(1,2:3);a(2,1:2)] sel...

select from matrix!

When executing the command it outputs : b = 3 2 2 1 The command : b= [a(1,2:3);a(2,1:2)] sel...

3 months ago | 1

| accepted

Answered

plot standard deviation as a shaded area

You can use the code directly from this answer: https://mathworks.com/matlabcentral/answers/180829-shade-area-between-graphs#an...

plot standard deviation as a shaded area

You can use the code directly from this answer: https://mathworks.com/matlabcentral/answers/180829-shade-area-between-graphs#an...

3 months ago | 1

Answered

How to make a array from a loop?

You can do something like: nb = 1440; j = zeros(1,nb); Z = zeros(1,nb); for i = 1 : nb Z(i) = powerConsumption(i) - sol...

How to make a array from a loop?

You can do something like: nb = 1440; j = zeros(1,nb); Z = zeros(1,nb); for i = 1 : nb Z(i) = powerConsumption(i) - sol...

3 months ago | 0

Answered

System unit-impulse response for given tau

There is a problem of dimensions for matrix multiplication at line 5 and 6 : x1 = (A/tau1)*exp(t/-tau1) x2 = (A/tau2)*exp(t/-t...

System unit-impulse response for given tau

There is a problem of dimensions for matrix multiplication at line 5 and 6 : x1 = (A/tau1)*exp(t/-tau1) x2 = (A/tau2)*exp(t/-t...

3 months ago | 0

Answered

When we use the ";" at the end of a command line and when we do not use it

From https://www.tutorialspoint.com/matlab/matlab_syntax.htm : Semicolon (;) indicates end of statement. However, if you want t...

When we use the ";" at the end of a command line and when we do not use it

From https://www.tutorialspoint.com/matlab/matlab_syntax.htm : Semicolon (;) indicates end of statement. However, if you want t...

3 months ago | 0

Answered

adding element to a matrix row

You can read this to know about matrix indexing: https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matl...

adding element to a matrix row

You can read this to know about matrix indexing: https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matl...

3 months ago | 0

| accepted

Answered

Control of inverted pendulum

I don't find anything similar in literature LQR algorithm with state estimator is very common and you can find plenty of exampl...

Control of inverted pendulum

I don't find anything similar in literature LQR algorithm with state estimator is very common and you can find plenty of exampl...

3 months ago | 0

Answered

Find elements in a matrix

You can get the indices with: idx = A >= 30 & A <= 65 To know the number of values corresponding to the condition: numel(find...

Find elements in a matrix

You can get the indices with: idx = A >= 30 & A <= 65 To know the number of values corresponding to the condition: numel(find...

3 months ago | 0

Answered

Is there any maximum for the size of matlab table?

It depends on what you want to store into this table. You can have a look here to find more informations: https://mathworks.com...

Is there any maximum for the size of matlab table?

It depends on what you want to store into this table. You can have a look here to find more informations: https://mathworks.com...

3 months ago | 0

Solved

Find the maximum number of decimal places in a set of numbers

Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

3 months ago

Answered

function rand with variables

You can use something like this, adapt it to your case: a = 1; b = 2; c = 3; A = [a b c]; nb = 10; vec = zeros(1,nb); for...

function rand with variables

You can use something like this, adapt it to your case: a = 1; b = 2; c = 3; A = [a b c]; nb = 10; vec = zeros(1,nb); for...

3 months ago | 0

Solved

Check that number is whole number

Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...

3 months ago

Answered

('tf' requires one of the following) "tf commend is not working" HELP PLS!

Your code is right, but you do not have the required toolbox. The function tf is part of the 4 toolbox listed in the error messa...

('tf' requires one of the following) "tf commend is not working" HELP PLS!

Your code is right, but you do not have the required toolbox. The function tf is part of the 4 toolbox listed in the error messa...

3 months ago | 1

| accepted

Answered

Any methods to solve optimal control indirect method such as Pontryagin Minimum Principle?

Hi, here are some related questions to start with: https://mathworks.com/matlabcentral/answers/440335-how-to-implement-optimal...

Any methods to solve optimal control indirect method such as Pontryagin Minimum Principle?

Hi, here are some related questions to start with: https://mathworks.com/matlabcentral/answers/440335-how-to-implement-optimal...

3 months ago | 0

Answered

Vectors must be the same length.

What lines causes the error ? Following one ? g = plot(t,delta_omega_laser ); t and delta_omega_laser must have the same leng...

Vectors must be the same length.

What lines causes the error ? Following one ? g = plot(t,delta_omega_laser ); t and delta_omega_laser must have the same leng...

4 months ago | 0

| accepted

Answered

assign variable name to Function Output Variables

Why don't you just change [wave_rms]=waveform(wave) into [Uph_rms]=waveform(wave) ?

assign variable name to Function Output Variables

Why don't you just change [wave_rms]=waveform(wave) into [Uph_rms]=waveform(wave) ?

4 months ago | 0

Answered

Taking in a function as an argument

How is testfunc defined ? Here is a simple working example: function out = func(inputfunc, constant1, constant2) out = inputf...

Taking in a function as an argument

How is testfunc defined ? Here is a simple working example: function out = func(inputfunc, constant1, constant2) out = inputf...

4 months ago | 0

Answered

How idx runs and give its value ?

abs(a-n) = 1.8000 2.0000 4.0000 6.3000 6.5000 then min(abs(a-n)) = 1.8, and the location of this minimum value...

How idx runs and give its value ?

abs(a-n) = 1.8000 2.0000 4.0000 6.3000 6.5000 then min(abs(a-n)) = 1.8, and the location of this minimum value...

4 months ago | 0

Answered

Servo control without controller

have you tried something so far ? Do you need help to connect matlab and the motor ? In this case you should specify what is y...

Servo control without controller

have you tried something so far ? Do you need help to connect matlab and the motor ? In this case you should specify what is y...

4 months ago | 0

Answered

plot a defined function

plot the function N(T) versus T in range 0.1 to 14 T is known ? T =[0.1 : 14 ] ? And you want to plot ne(T) ? In this case yo...

plot a defined function

plot the function N(T) versus T in range 0.1 to 14 T is known ? T =[0.1 : 14 ] ? And you want to plot ne(T) ? In this case yo...

4 months ago | 0

Answered

Problem with Discrete Controller Design

It could actually be both. It is indeed possible that the discretization with a given frequency brings problems such as oversa...

Problem with Discrete Controller Design

It could actually be both. It is indeed possible that the discretization with a given frequency brings problems such as oversa...

5 months ago | 0