927 total contributions since 2017

Knowledge means knowing where it is written...

Interested in:

- Optimization

- Mathematical Modelling

- Improvement of my programming skills

Answered

filter string in the string

str = 'this matlab is a good software, it is a version 9.4 which is equal to 2018a' str = char(str); idx = find((uint8(str)>=...

filter string in the string

str = 'this matlab is a good software, it is a version 9.4 which is equal to 2018a' str = char(str); idx = find((uint8(str)>=...

약 15시간 ago | 0

Answered

Reading Data from txt file with a unique FormatSpec

One way: A = reshape(double(replace(string(readcell('Test.txt')),["[[", "[", "]", "]]"],["", "", "", ""])),[],12) This uses th...

Reading Data from txt file with a unique FormatSpec

One way: A = reshape(double(replace(string(readcell('Test.txt')),["[[", "[", "]", "]]"],["", "", "", ""])),[],12) This uses th...

약 19시간 ago | 0

| accepted

Answered

Solving a ODE in matlab

ode = @(t,y) y.^2-y.*0.1*cos(2.*t)-0.2*cos(2.*t); t=[0 8]; y0 = -1; [t,y] = ode45(ode,t,y0); plot(t,y)

Solving a ODE in matlab

ode = @(t,y) y.^2-y.*0.1*cos(2.*t)-0.2*cos(2.*t); t=[0 8]; y0 = -1; [t,y] = ode45(ode,t,y0); plot(t,y)

약 19시간 ago | 1

Answered

n x 1 array, add row-wise

https://de.mathworks.com/help/matlab/ref/cumsum.html A = [1 3 4 5 3 8 3]' B = cumsum(A)

n x 1 array, add row-wise

https://de.mathworks.com/help/matlab/ref/cumsum.html A = [1 3 4 5 3 8 3]' B = cumsum(A)

약 20시간 ago | 0

| accepted

Answered

help to convert text file symbol into array

Assuming you import this as a string, you could use: a = "4c07b] IF hit state: 5 (S) valid:" b = char(a) c = b(:) which give...

help to convert text file symbol into array

Assuming you import this as a string, you could use: a = "4c07b] IF hit state: 5 (S) valid:" b = char(a) c = b(:) which give...

1일 ago | 0

| accepted

Answered

Run a code for several values

Sounds like you might be interested in vectorization.

Run a code for several values

Sounds like you might be interested in vectorization.

1일 ago | 0

Answered

write a function that takes any equation as an input

You might to want to achieve this: % Inputs xvals = 0:0.01:10; fun = @(x) x.^5 + sin(x); % call function res = splinecalc...

write a function that takes any equation as an input

You might to want to achieve this: % Inputs xvals = 0:0.01:10; fun = @(x) x.^5 + sin(x); % call function res = splinecalc...

1일 ago | 1

Answered

How to extract specific images from a library of images?

You can construct a string array of the desired file names like follows: exceldata = [0,3,8,12,16,224]; filenames = string(100...

How to extract specific images from a library of images?

You can construct a string array of the desired file names like follows: exceldata = [0,3,8,12,16,224]; filenames = string(100...

1일 ago | 0

| accepted

Answered

Solving a system of second order differential equations (coupled mass-spring system)

syms X1(t) X2(t) K f m1 m2 Y t EqX1 = diff(X1,2) == K*(X1-X2)/m1; EqX2 = diff(X2,2) == f + K*(X2-X1)/m2; [ODE,Vars] = odeTo...

Solving a system of second order differential equations (coupled mass-spring system)

syms X1(t) X2(t) K f m1 m2 Y t EqX1 = diff(X1,2) == K*(X1-X2)/m1; EqX2 = diff(X2,2) == f + K*(X2-X1)/m2; [ODE,Vars] = odeTo...

5일 ago | 0

| accepted

Answered

Why INTLINPROG returns non-integer?

load intlinprogfail.mat % file attached intcon = 1:45; [x, ~, flag] = intlinprog(fdummy, intcon, [], [], Aeq, beq, lb, ub); r...

Why INTLINPROG returns non-integer?

load intlinprogfail.mat % file attached intcon = 1:45; [x, ~, flag] = intlinprog(fdummy, intcon, [], [], Aeq, beq, lb, ub); r...

6일 ago | 1

| accepted

Answered

comparing the two arrays

x1=[1,2,3,2,0,3,4,3,5,4,5,6,8]; x2=[3,0]; res = zeros(1,numel(x2)); for k = 1:numel(x2) res(k) = sum(ismember(x1,x2(k)...

comparing the two arrays

x1=[1,2,3,2,0,3,4,3,5,4,5,6,8]; x2=[3,0]; res = zeros(1,numel(x2)); for k = 1:numel(x2) res(k) = sum(ismember(x1,x2(k)...

10일 ago | 0

| accepted

Answered

matlab code for lagrange method?

Hint: Answers has a search function. We will not write your code - learn from examples: <https://de.mathworks.com/matlabce...

matlab code for lagrange method?

Hint: Answers has a search function. We will not write your code - learn from examples: <https://de.mathworks.com/matlabce...

10일 ago | 0

| accepted

Answered

Selecting data in an array based on a logical value array?

<https://de.mathworks.com/help/matlab/math/array-indexing.html#MatrixIndexingExample-3>

Selecting data in an array based on a logical value array?

<https://de.mathworks.com/help/matlab/math/array-indexing.html#MatrixIndexingExample-3>

11일 ago | 1

| accepted

Answered

Optimization of equation with 3 variables

<https://de.mathworks.com/help/optim/ug/fmincon.html>

Optimization of equation with 3 variables

<https://de.mathworks.com/help/optim/ug/fmincon.html>

12일 ago | 1

Answered

check if random numbers( 5x5) generated are greater than (1x5)

Here is an example using <https://de.mathworks.com/help/matlab/ref/gt.html gt (greather than)> and <https://de.mathworks.com/hel...

check if random numbers( 5x5) generated are greater than (1x5)

Here is an example using <https://de.mathworks.com/help/matlab/ref/gt.html gt (greather than)> and <https://de.mathworks.com/hel...

19일 ago | 0

| accepted

Answered

how do i get Matlab compiler for home users?

At the Moment there is no way to get this with a home license. You can only hope that TMW will someday change his policy - or yo...

how do i get Matlab compiler for home users?

At the Moment there is no way to get this with a home license. You can only hope that TMW will someday change his policy - or yo...

21일 ago | 0

Answered

how with ode45 order we can solve a switching problem?

<https://de.mathworks.com/help/matlab/math/ode-event-location.html>

how with ode45 order we can solve a switching problem?

<https://de.mathworks.com/help/matlab/math/ode-event-location.html>

23일 ago | 0

Answered

My gamultobj nonlinear constraints are being ignored

Get rid of the <= operators, they make the result of myCon a logical zero vector, which brings trouble. Use this instead, to cal...

My gamultobj nonlinear constraints are being ignored

Get rid of the <= operators, they make the result of myCon a logical zero vector, which brings trouble. Use this instead, to cal...

23일 ago | 2

Answered

Working with table.

Your_Table_new = Your_Table(Your_Table.Recommeded_Working_Hours >= 3000,:);

Working with table.

Your_Table_new = Your_Table(Your_Table.Recommeded_Working_Hours >= 3000,:);

25일 ago | 0

| accepted

Answered

Function "solve" returns a struct

syms a1 a2 q1 q2 eq = a1*cos(q1) + a2*cos(q1)*cos(q2) - a2*sin(q1)*sin(q2) == 0 sol = isolate(eq,cos(q1)) pretty(sol)

Function "solve" returns a struct

syms a1 a2 q1 q2 eq = a1*cos(q1) + a2*cos(q1)*cos(q2) - a2*sin(q1)*sin(q2) == 0 sol = isolate(eq,cos(q1)) pretty(sol)

25일 ago | 0

Answered

MATLAB codeto python code conversion

There is no tool to do this in an automatic manner. To do this you can seither do (let) this by hand or you use the free Matlab ...

MATLAB codeto python code conversion

There is no tool to do this in an automatic manner. To do this you can seither do (let) this by hand or you use the free Matlab ...

26일 ago | 1

| accepted

Answered

Showing years on x axis graph

<https://de.mathworks.com/help/matlab/ref/xticks.html>

Showing years on x axis graph

<https://de.mathworks.com/help/matlab/ref/xticks.html>

29일 ago | 0

Answered

Read images from different subfolders and create movie from them?!

I suggest to read about the <https://de.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.html imageDatastore> fu...

Read images from different subfolders and create movie from them?!

I suggest to read about the <https://de.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.html imageDatastore> fu...

29일 ago | 0

Answered

Creating a sequence with repeating numbers

b = repelem(1:430,1,2) or for a column: b = (repelem(1:430,1,2))'

Creating a sequence with repeating numbers

b = repelem(1:430,1,2) or for a column: b = (repelem(1:430,1,2))'

약 1달 ago | 1

Answered

How to read whole image dataset, and how to resize all images at once?

I suggest to read about <https://de.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.html ImageDataStore> and re...

How to read whole image dataset, and how to resize all images at once?

I suggest to read about <https://de.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.html ImageDataStore> and re...

약 1달 ago | 0

Answered

4 non-linear differential equations with ODE45

working scripts: %% V�rdier % parametre: % Carrying capacity k1 = 500; k2 = 600; k3 = 700; % De incubated males and ...

4 non-linear differential equations with ODE45

working scripts: %% V�rdier % parametre: % Carrying capacity k1 = 500; k2 = 600; k3 = 700; % De incubated males and ...

약 1달 ago | 0

Answered

How do I solve for three unknown parameters using only one constraint equation?

you should rewrite your function as *f=d(P)* with known constants (*R*) and use <https://de.mathworks.com/help/optim/ug/lsqcurve...

How do I solve for three unknown parameters using only one constraint equation?

you should rewrite your function as *f=d(P)* with known constants (*R*) and use <https://de.mathworks.com/help/optim/ug/lsqcurve...

약 1달 ago | 0

Answered

How to save a variable from an anonymous function?

for nonlcon it's not necessarily an anonymous function that is needed. you can also use a "normal" function, so that you can sav...

How to save a variable from an anonymous function?

for nonlcon it's not necessarily an anonymous function that is needed. you can also use a "normal" function, so that you can sav...

약 1달 ago | 1

Answered

Reshape Matrix Size Marlab

<https://de.mathworks.com/help/comm/ref/bi2de.html>

Reshape Matrix Size Marlab

<https://de.mathworks.com/help/comm/ref/bi2de.html>

약 1달 ago | 0

| accepted