Knowledge means knowing where it is written...

Interested in:

- Optimization

- Mathematical Modelling

- Improvement of my programming skills

Answered

How to use fsolve when a nonlinear equation given two arrays of parameters (not the variables)? Why can't I use for loop?

Hi, you could try to vectorize your function in order to avoid for loops - here is a simple example: % Constant 1 as a row vec...

How to use fsolve when a nonlinear equation given two arrays of parameters (not the variables)? Why can't I use for loop?

Hi, you could try to vectorize your function in order to avoid for loops - here is a simple example: % Constant 1 as a row vec...

15 días ago | 0

Answered

Question about GA and the fun.

Have a read here: https://de.mathworks.com/help/optim/ug/passing-extra-parameters.html In your case it should look somehow lik...

Question about GA and the fun.

Have a read here: https://de.mathworks.com/help/optim/ug/passing-extra-parameters.html In your case it should look somehow lik...

15 días ago | 2

| accepted

Answered

Help me I am unable to input array

They way you coded it needs to enter the single values one after each other: Enter elements of x=1 Enter elements of x=2 Ente...

Help me I am unable to input array

They way you coded it needs to enter the single values one after each other: Enter elements of x=1 Enter elements of x=2 Ente...

16 días ago | 0

| accepted

Answered

Problems using LSTM with PPO Agent - Error: Invalid input argument type or size such as observation, reward, isdone or loggedSignals.

I finally could solve the issue. The problem was that there were 2 LSTM layers in the network, which led to the error: Caused b...

Problems using LSTM with PPO Agent - Error: Invalid input argument type or size such as observation, reward, isdone or loggedSignals.

I finally could solve the issue. The problem was that there were 2 LSTM layers in the network, which led to the error: Caused b...

19 días ago | 1

| accepted

Question

Problems using LSTM with PPO Agent - Error: Invalid input argument type or size such as observation, reward, isdone or loggedSignals.

Hi, i implemented some RL agents (DQN, AC, PPO...) successfully with my custom environment function by using a feedforward netw...

21 días ago | 1 answer | 0

Answered

numerically solving an equation involving a matlab function with multiple variables

fun = @(x) blsprice(5,2,0.05,x,0.2) - 4; unknown_time = fsolve(fun,0.5)

numerically solving an equation involving a matlab function with multiple variables

fun = @(x) blsprice(5,2,0.05,x,0.2) - 4; unknown_time = fsolve(fun,0.5)

alrededor de 1 mes ago | 1

| accepted

Answered

I want to get 2d image from a sensor data.What matlab commands convert a dataset to images?

A = rand(100,100) imshow(A) or A = (randi(1500,100,100))-750 image(A)

I want to get 2d image from a sensor data.What matlab commands convert a dataset to images?

A = rand(100,100) imshow(A) or A = (randi(1500,100,100))-750 image(A)

alrededor de 1 mes ago | 0

Answered

How can I name matrices generated by a for loop as Z1,Z2,Z3 ...etc.

There are a lot of contributions (one of the best is here) which show why this way of coding is bad - use an efficient way by in...

How can I name matrices generated by a for loop as Z1,Z2,Z3 ...etc.

There are a lot of contributions (one of the best is here) which show why this way of coding is bad - use an efficient way by in...

alrededor de 1 mes ago | 1

| accepted

Answered

Problem with solve matrix

For me your code works: disp('An economic system composed of 3 sectors has the input-output matrix'); D=[0.5,0.1,0.1;0.2,0.5,0...

Problem with solve matrix

For me your code works: disp('An economic system composed of 3 sectors has the input-output matrix'); D=[0.5,0.1,0.1;0.2,0.5,0...

alrededor de 1 mes ago | 0

| accepted

Answered

ode45 solver code for solving a system of three coupled equations does not work

Your ode appears to be stiff - therefore i recommend to use ode15s instead of ode45. Also the behaviour of your system can be se...

ode45 solver code for solving a system of three coupled equations does not work

Your ode appears to be stiff - therefore i recommend to use ode15s instead of ode45. Also the behaviour of your system can be se...

alrededor de 2 meses ago | 1

| accepted

Answered

i want to read a csv file and store as rows and columns of a cell

fileID = fopen('FOM_HFA_Pavg.csv'); content = textscan(fileID, '%s','Delimiter','\t'); fclose(fileID); content = content{:}; ...

i want to read a csv file and store as rows and columns of a cell

fileID = fopen('FOM_HFA_Pavg.csv'); content = textscan(fileID, '%s','Delimiter','\t'); fclose(fileID); content = content{:}; ...

alrededor de 2 meses ago | 0

| accepted

Answered

calculate and plot the following differential equation using ODE45solver.

y0=0.5; %intial value h=0.8; % t=[0 4]; %tspan [t,y] =ode45(@(t,y)-y+sin(t), t,y0); plot(t,y,'-o'); xlabel('time'); ylabel...

calculate and plot the following differential equation using ODE45solver.

y0=0.5; %intial value h=0.8; % t=[0 4]; %tspan [t,y] =ode45(@(t,y)-y+sin(t), t,y0); plot(t,y,'-o'); xlabel('time'); ylabel...

alrededor de 2 meses ago | 0

| accepted

Answered

using Q learning agent for continuous observation space

You also are allowed to write a custom critic function: https://de.mathworks.com/help/reinforcement-learning/ref/rlqvaluerepres...

using Q learning agent for continuous observation space

You also are allowed to write a custom critic function: https://de.mathworks.com/help/reinforcement-learning/ref/rlqvaluerepres...

alrededor de 2 meses ago | 0

Answered

question ..question about engine matlab

Your code works - you only need to call your function and plot the results: % Call the function and save results in W and Fa [...

question ..question about engine matlab

Your code works - you only need to call your function and plot the results: % Call the function and save results in W and Fa [...

alrededor de 2 meses ago | 0

Answered

Calculate a letter from equation with letters.

You might want to do this: syms Xe Ye a1 a2 cos1 cos2 sin1 sin2 eq(1) = Xe == a2*(cos1*cos2-sin1*sin2)+a1*cos1; eq(2) = Ye ==...

Calculate a letter from equation with letters.

You might want to do this: syms Xe Ye a1 a2 cos1 cos2 sin1 sin2 eq(1) = Xe == a2*(cos1*cos2-sin1*sin2)+a1*cos1; eq(2) = Ye ==...

alrededor de 2 meses ago | 0

Answered

FZERO cannot continue because user-supplied function_handle ==> @(M)FindM(M,N(k),Q,wn(i)) failed with the error below.

Declare the code in findM_1P as a function and give it proper input and output arguments, to make it possible for fzero passing ...

FZERO cannot continue because user-supplied function_handle ==> @(M)FindM(M,N(k),Q,wn(i)) failed with the error below.

Declare the code in findM_1P as a function and give it proper input and output arguments, to make it possible for fzero passing ...

alrededor de 2 meses ago | 0

Answered

IMRT Beam angle optimization

You might want to read the dissertation from Mark Bangert, which includes a rich bibliography: http://archiv.ub.uni-heidelberg....

IMRT Beam angle optimization

You might want to read the dissertation from Mark Bangert, which includes a rich bibliography: http://archiv.ub.uni-heidelberg....

2 meses ago | 0

| accepted

Answered

Error in bin2dec ?

You are not doing wrong - just read the documentation: "...If the input argument D has a value greater than the value returned ...

Error in bin2dec ?

You are not doing wrong - just read the documentation: "...If the input argument D has a value greater than the value returned ...

2 meses ago | 1

Answered

Combining 3 curves into 1 average

Here is a simple example: % fantasy times times1 = 1:10 times2 = 1:2:11 % fantasy values y1 = 2 * (1:10) y2 = 4 * (1:2:1...

Combining 3 curves into 1 average

Here is a simple example: % fantasy times times1 = 1:10 times2 = 1:2:11 % fantasy values y1 = 2 * (1:10) y2 = 4 * (1:2:1...

2 meses ago | 0

Answered

A problem while using lsqnonlin

Use the same random numbers for the same results: rng('default') d = linspace(0,3); y = exp(-1.3*d) + 0.05*randn(size(d)); ...

A problem while using lsqnonlin

Use the same random numbers for the same results: rng('default') d = linspace(0,3); y = exp(-1.3*d) + 0.05*randn(size(d)); ...

2 meses ago | 0

| accepted

Answered

Not getting six coupled ODEs solution using bvp4c in MATLAB, Please help me

I used nested functions - for 2 of the constants you did not provide values: % Call the outer function finalprogramme %% Ou...

Not getting six coupled ODEs solution using bvp4c in MATLAB, Please help me

I used nested functions - for 2 of the constants you did not provide values: % Call the outer function finalprogramme %% Ou...

2 meses ago | 0

| accepted

Answered

Environment Reinforcment learning Matlab

See this link to the documentation: https://de.mathworks.com/help/reinforcement-learning/ug/create-custom-reinforcement-learnin...

Environment Reinforcment learning Matlab

See this link to the documentation: https://de.mathworks.com/help/reinforcement-learning/ug/create-custom-reinforcement-learnin...

2 meses ago | 0

Answered

Custom Environment for Reinforcment learning

There is a step-by-step example in the documentaion: https://de.mathworks.com/help/reinforcement-learning/ug/create-custom-rein...

Custom Environment for Reinforcment learning

There is a step-by-step example in the documentaion: https://de.mathworks.com/help/reinforcement-learning/ug/create-custom-rein...

2 meses ago | 0

Answered

Please tell me how?

You need to perform a inverse laplace transformation: num=134; den=[1 16 134]; x=tf(num,den) subplot(1,2,1) step(x) title(...

Please tell me how?

You need to perform a inverse laplace transformation: num=134; den=[1 16 134]; x=tf(num,den) subplot(1,2,1) step(x) title(...

2 meses ago | 1

Answered

write function that generates an echo to audio

Hi Franziska, there is no need for loops: % Load sample sound load TestSoundEcho.mat; % Play sample sound sound(data, fs)...

write function that generates an echo to audio

Hi Franziska, there is no need for loops: % Load sample sound load TestSoundEcho.mat; % Play sample sound sound(data, fs)...

2 meses ago | 0

Answered

Output a solution for a function at a specific value input

magT = @(omega)sqrt((5.903*10^24)^2+(1.181*10^20*omega)^2)/sqrt((1.181*10^25-(2.361*10^16*omega^2))^2+(9.445*10^20*omega)^2); ...

Output a solution for a function at a specific value input

magT = @(omega)sqrt((5.903*10^24)^2+(1.181*10^20*omega)^2)/sqrt((1.181*10^25-(2.361*10^16*omega^2))^2+(9.445*10^20*omega)^2); ...

2 meses ago | 0

| accepted

Answered

solving integral in matlab

What you are looking for is an analytical solution. The integral function does solve numeric. To solve symbolic use int as John ...

solving integral in matlab

What you are looking for is an analytical solution. The integral function does solve numeric. To solve symbolic use int as John ...

2 meses ago | 1

Answered

Split data into groups

A = randi(5000,300,1); % random data A = sortrows(A); % sort it low = A(1:100); % just use indexing now mid = A(101:200); hi...

Split data into groups

A = randi(5000,300,1); % random data A = sortrows(A); % sort it low = A(1:100); % just use indexing now mid = A(101:200); hi...

2 meses ago | 0

| accepted

Answered

Syntax error when opening a file using a path. it says " use a newline, semicolon, or comma before this statement "

It is unclear what you want: maybe you forgot to underline your variable name function_data = angleAnalysis_withPlots('C:/rese...

Syntax error when opening a file using a path. it says " use a newline, semicolon, or comma before this statement "

It is unclear what you want: maybe you forgot to underline your variable name function_data = angleAnalysis_withPlots('C:/rese...

2 meses ago | 0

Answered

HELP: looping a function and plot (ode23)

tspan1 = [0, 4]; tspan2 = [4, 10]; y0 = [0, 0]; [t1_r1, y1_r1] = ode23(@(t,y) fun(t,y,0.5,5), tspan1, y0); [t2_r1, y2_r1] ...

HELP: looping a function and plot (ode23)

tspan1 = [0, 4]; tspan2 = [4, 10]; y0 = [0, 0]; [t1_r1, y1_r1] = ode23(@(t,y) fun(t,y,0.5,5), tspan1, y0); [t2_r1, y2_r1] ...

2 meses ago | 1

| accepted