864 total contributions since 2017

Knowledge means knowing where it is written...

Interested in:

- Optimization

- Mathematical Modelling

- Improvement of my programming skills

Answered

why am i getting 'Illegal use of reserved keyword "elseif" while running this program?

change the line % designate gait characteristic if rv <= 0 to % designate gait characteristic if rv <= 0 ...

why am i getting 'Illegal use of reserved keyword "elseif" while running this program?

change the line % designate gait characteristic if rv <= 0 to % designate gait characteristic if rv <= 0 ...

6 hours ago | 0

| accepted

Answered

Solving system of non-linear trigonometric symbolic equations

syms theta1 theta2 theta3 theta4 format long M_SUM = [(cos(theta1) + sin(theta1)/2)*(cos(theta1)/2 + sin(theta1)) + (cos(the...

Solving system of non-linear trigonometric symbolic equations

syms theta1 theta2 theta3 theta4 format long M_SUM = [(cos(theta1) + sin(theta1)/2)*(cos(theta1)/2 + sin(theta1)) + (cos(the...

13 hours ago | 2

Answered

Optimisation - fmincon error

Rename your script. NEVER name a script like an inbuilt function. This causes exactly the error you get.

Optimisation - fmincon error

Rename your script. NEVER name a script like an inbuilt function. This causes exactly the error you get.

19 hours ago | 1

| accepted

Answered

Difficulty implementing simulated annealing algorithm

rng default % For reproducibility x0 = [0.5 0.5]; % Starting point [x,y,flag,output] = simulannealbnd(@simple_objective,x0) ...

Difficulty implementing simulated annealing algorithm

rng default % For reproducibility x0 = [0.5 0.5]; % Starting point [x,y,flag,output] = simulannealbnd(@simple_objective,x0) ...

20 hours ago | 0

| accepted

Answered

I am trying to get non-negative values for the lsqlin function

https://de.mathworks.com/help/matlab/ref/lsqnonneg.html

I am trying to get non-negative values for the lsqlin function

https://de.mathworks.com/help/matlab/ref/lsqnonneg.html

21 hours ago | 0

Answered

creating a new column with three columns

Works also if the number of lines or columns is different to 25x3: a = [col1 col2 col3] b = reshape(a',[],1)

creating a new column with three columns

Works also if the number of lines or columns is different to 25x3: a = [col1 col2 col3] b = reshape(a',[],1)

1 day ago | 0

Answered

How can I use GA to specific variants with discrete variables?

Maybe you are interested in this question - and of course the answer: https://de.mathworks.com/matlabcentral/answers/401059-set...

How can I use GA to specific variants with discrete variables?

Maybe you are interested in this question - and of course the answer: https://de.mathworks.com/matlabcentral/answers/401059-set...

1 day ago | 0

Answered

what does mean: "@(x) ....."?

execute this code: x = 1:10 % create a vector with elements from 1...10 a = x(end) % access last element of vector...

what does mean: "@(x) ....."?

execute this code: x = 1:10 % create a vector with elements from 1...10 a = x(end) % access last element of vector...

1 day ago | 1

Answered

linsolve time-consuming

Get rid of symbolic calculation - this makes code very slow and solve numeric: clear X Y % This works if your values are of si...

linsolve time-consuming

Get rid of symbolic calculation - this makes code very slow and solve numeric: clear X Y % This works if your values are of si...

3 days ago | 2

Answered

Not able to solve an ode using dsolve

Consider: syms y(t) ode = diff(y,t) == -0.127.*(-3.*(log(7e-10.*exp(0.405.*y))).*(y - 0.01)); cond1 = y(0) == 0.01; co...

Not able to solve an ode using dsolve

Consider: syms y(t) ode = diff(y,t) == -0.127.*(-3.*(log(7e-10.*exp(0.405.*y))).*(y - 0.01)); cond1 = y(0) == 0.01; co...

3 days ago | 0

| accepted

Answered

How to solve a system of third order non-linear differential equations

% create a 1.order system and a function handle syms u(t) w(t) r h nue eq(1) = diff(u,t,2) == -1/r*diff(u,t)+u/r-(1-nue)/2*r...

How to solve a system of third order non-linear differential equations

% create a 1.order system and a function handle syms u(t) w(t) r h nue eq(1) = diff(u,t,2) == -1/r*diff(u,t)+u/r-(1-nue)/2*r...

4 days ago | 0

Answered

logical expression in objective function

Hi, use the inequality constraints A and b as input arguments for the solver.

logical expression in objective function

Hi, use the inequality constraints A and b as input arguments for the solver.

4 days ago | 1

Answered

Plotting a concatenated function (GUI)

https://de.mathworks.com/help/matlab/ref/str2func.html x=-5:.5:5 funy2=str2func('1.*x.^2+5*x+6') plot(x,funy2(x))

Plotting a concatenated function (GUI)

https://de.mathworks.com/help/matlab/ref/str2func.html x=-5:.5:5 funy2=str2func('1.*x.^2+5*x+6') plot(x,funy2(x))

5 days ago | 1

| accepted

Answered

Why do I get 'Undefined function or variable'?

If u is calculated inside the function it should not be an input argument of the function. Also delete varargin - no need - resu...

Why do I get 'Undefined function or variable'?

If u is calculated inside the function it should not be an input argument of the function. Also delete varargin - no need - resu...

8 days ago | 0

Answered

Fval Output by ga does not match output of fitness function evaluated at the respective x vector

you problably are are victim of rounding errors. try: FullDevice(x) to use the exact results of x as input for your Fitn...

Fval Output by ga does not match output of fitness function evaluated at the respective x vector

you problably are are victim of rounding errors. try: FullDevice(x) to use the exact results of x as input for your Fitn...

13 days ago | 0

| accepted

Answered

Plotting the different solution via fzero solver against a range of one of the variable

N = 100; % define the parameters Nd = 1e23; e = 12*1e-12; %r = 0 R = 20*1e-9; Et_Ef = -0.21*1.6*1e-19; K = 1.3807e-...

Plotting the different solution via fzero solver against a range of one of the variable

N = 100; % define the parameters Nd = 1e23; e = 12*1e-12; %r = 0 R = 20*1e-9; Et_Ef = -0.21*1.6*1e-19; K = 1.3807e-...

19 days ago | 0

| accepted

Answered

Optimizing a matrix with cplexlp?

Hi, you could think about using graphs for this job: % your matrix A = [0 1 0 0 0 0 0 0 0 0; 1 0 1 0 0 0 0 0 0 0; 0...

Optimizing a matrix with cplexlp?

Hi, you could think about using graphs for this job: % your matrix A = [0 1 0 0 0 0 0 0 0 0; 1 0 1 0 0 0 0 0 0 0; 0...

20 days ago | 1

| accepted

Answered

lsqcurvefit cannot evaluate initial function, says insufficient input arguments

Have a read here: https://de.mathworks.com/matlabcentral/answers/465406-fmincon-error-not-enough-input-arguments it appears to...

lsqcurvefit cannot evaluate initial function, says insufficient input arguments

Have a read here: https://de.mathworks.com/matlabcentral/answers/465406-fmincon-error-not-enough-input-arguments it appears to...

22 days ago | 1

| accepted

Answered

Fmincon error not enough input arguments

Your objective function takes 2 input arguments - by default the optimization solvers only use 1 argument, which is the vector o...

Fmincon error not enough input arguments

Your objective function takes 2 input arguments - by default the optimization solvers only use 1 argument, which is the vector o...

22 days ago | 3

Answered

Why doesn't this code rotate and transform the spiral?

No for loop is needed: t = linspace( 0,4*pi,1000); r=@(t) sqrt(t); x = r(t).*cos(t); y = r(t).*sin(t); plot(x,y) %turns x...

Why doesn't this code rotate and transform the spiral?

No for loop is needed: t = linspace( 0,4*pi,1000); r=@(t) sqrt(t); x = r(t).*cos(t); y = r(t).*sin(t); plot(x,y) %turns x...

23 days ago | 0

Answered

Solving two differential equations using ode45

This will help: https://de.mathworks.com/help/symbolic/odetovectorfield.html Follow the given examples and adapt them to your ...

Solving two differential equations using ode45

This will help: https://de.mathworks.com/help/symbolic/odetovectorfield.html Follow the given examples and adapt them to your ...

23 days ago | 1

| accepted

Answered

can anyone help me ?

clear all; clc; close all; N=[100,200,300,400]; hold on for k=1:numel(N) %%les données mathématiques t = 0:1/(N(k)...

can anyone help me ?

clear all; clc; close all; N=[100,200,300,400]; hold on for k=1:numel(N) %%les données mathématiques t = 0:1/(N(k)...

24 days ago | 0

Answered

Need to solve this

I assume you want real Solutions. Then try: syms a b c assume ([a b c], 'real') eq = [a+b == 204;... a+b*exp(-105*c) ==...

Need to solve this

I assume you want real Solutions. Then try: syms a b c assume ([a b c], 'real') eq = [a+b == 204;... a+b*exp(-105*c) ==...

25 days ago | 1

Answered

How can I delete the elements of array on MATLAB?

To delete an array use: array1 = [];

How can I delete the elements of array on MATLAB?

To delete an array use: array1 = [];

26 days ago | 1

| accepted

Answered

ode23 and ode45 problem

% Solve symbolic (blue line in plot) syms y(x) x eqn = diff(y,x) == -2*x+4*y^2 sol_symbolic = dsolve(eqn,y(0)==0); fplot(sol...

ode23 and ode45 problem

% Solve symbolic (blue line in plot) syms y(x) x eqn = diff(y,x) == -2*x+4*y^2 sol_symbolic = dsolve(eqn,y(0)==0); fplot(sol...

1 month ago | 0

| accepted

Answered

substitute one cell of 3D matrix with another cell

A(:,:,158) = I; % where I is the 512x512 image you want to insert

substitute one cell of 3D matrix with another cell

A(:,:,158) = I; % where I is the 512x512 image you want to insert

1 month ago | 0

| accepted

Answered

error variable y in fitness function

function y=fungsi3(x) y=2+exp(-(x(1).^2+x(2).^2)).*(sin(4*x(1))+cos(8*x(2))); end

error variable y in fitness function

function y=fungsi3(x) y=2+exp(-(x(1).^2+x(2).^2)).*(sin(4*x(1))+cos(8*x(2))); end

1 month ago | 0

Answered

How can I expand x axis to have normal plot?

A(:,1)=data{:,1}; A(:,2)=data{:,2}; A=sortrows(A,1); plot(A(:,1),A(:,2))

How can I expand x axis to have normal plot?

A(:,1)=data{:,1}; A(:,2)=data{:,2}; A=sortrows(A,1); plot(A(:,1),A(:,2))

1 month ago | 0

| accepted

Answered

Check to find if a row has an element occuring more than once

A = [0 0 1 1 0 0; 0 0 0 0 0 1; 1 1 0 0 0 1] res = (sum(A==1,2)>1) This works row-wise for more than 1 rows

Check to find if a row has an element occuring more than once

A = [0 0 1 1 0 0; 0 0 0 0 0 1; 1 1 0 0 0 1] res = (sum(A==1,2)>1) This works row-wise for more than 1 rows

1 month ago | 0

| accepted