Answered

Solve equation (unrecognized function or variable)

% define t as symbolic syms t N = 5.62; R = 6.40; W = 600; eqn = (10 + 2.*W.^(2).*t.^(2) - 8.*W.^(4).*t.^(4))./(10 +23.*...

Solve equation (unrecognized function or variable)

% define t as symbolic syms t N = 5.62; R = 6.40; W = 600; eqn = (10 + 2.*W.^(2).*t.^(2) - 8.*W.^(4).*t.^(4))./(10 +23.*...

10 hours ago | 0

Answered

How to doI plot F(x) = [1 -(10/x)]/[1-(100/x^2)] for X ranging from 100 to 1100 at an interval of 50?

F = @(x) (1-(10./x))./(1-(100./x.^2)); x_vals = 100:50:1100; plot (x_vals, F(x_vals))

How to doI plot F(x) = [1 -(10/x)]/[1-(100/x^2)] for X ranging from 100 to 1100 at an interval of 50?

F = @(x) (1-(10./x))./(1-(100./x.^2)); x_vals = 100:50:1100; plot (x_vals, F(x_vals))

15 hours ago | 2

Answered

Change frame rate of video file

You are fully right. First read all the frames using the read command for VideoReader. Then make a VideoWriter object and use th...

Change frame rate of video file

You are fully right. First read all the frames using the read command for VideoReader. Then make a VideoWriter object and use th...

21 hours ago | 0

Answered

How to optimise two variables at once

b = 166; %inertance c = 2000; %damping value lb = [0 500]; % lower bound ub = [500 3000]; % upper bound x0 = [b, c]; %...

How to optimise two variables at once

b = 166; %inertance c = 2000; %damping value lb = [0 500]; % lower bound ub = [500 3000]; % upper bound x0 = [b, c]; %...

22 hours ago | 0

| accepted

Answered

How to find every combination of values in a cell array?

One way, using allcomb: M = {[1,2,3], [4,5,6],[7,8,9]; [10,11],[12,13],[14,15]; [16,17,18,19,20],[21,22,23,24],[25,26,27,28]}...

How to find every combination of values in a cell array?

One way, using allcomb: M = {[1,2,3], [4,5,6],[7,8,9]; [10,11],[12,13],[14,15]; [16,17,18,19,20],[21,22,23,24],[25,26,27,28]}...

4 days ago | 1

| accepted

Answered

function in matlap#

https://de.mathworks.com/help/matlab/ref/function.html https://de.mathworks.com/help/matlab/matlab_prog/create-functions-in-fil...

function in matlap#

https://de.mathworks.com/help/matlab/ref/function.html https://de.mathworks.com/help/matlab/matlab_prog/create-functions-in-fil...

5 days ago | 0

Answered

How to ignore negative indices or assign it to zero in a loop

It is not needed to make the elements zero - they are already, because you preallocated y with zeros: x=[1 2 -1 -3 -4] h=[0 1 ...

How to ignore negative indices or assign it to zero in a loop

It is not needed to make the elements zero - they are already, because you preallocated y with zeros: x=[1 2 -1 -3 -4] h=[0 1 ...

6 days ago | 0

| accepted

Answered

Matlab schließt sich sofort nach dem starten wieder

Hallo, in diesem Forum wird fast ausschließlich auf Englisch geschrieben - was die Chance Deiner Frage beantwortet zu werden dr...

Matlab schließt sich sofort nach dem starten wieder

Hallo, in diesem Forum wird fast ausschließlich auf Englisch geschrieben - was die Chance Deiner Frage beantwortet zu werden dr...

6 days ago | 0

Answered

Helo everyone, I want to ask about my error in matlab. Error: File: Untitled5.m Line: 57 Column: 56 -> (rand(1,nvar).*c1.*(pbest(pop,:)x(pop,:))+...) Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or

Line 36: for iter=1:maxiter for pop=1:maxpop % update velocity v(pop,:)=w*v(pop,:)+... rand(1,nvar)...

Helo everyone, I want to ask about my error in matlab. Error: File: Untitled5.m Line: 57 Column: 56 -> (rand(1,nvar).*c1.*(pbest(pop,:)x(pop,:))+...) Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or

Line 36: for iter=1:maxiter for pop=1:maxpop % update velocity v(pop,:)=w*v(pop,:)+... rand(1,nvar)...

7 days ago | 0

Answered

Create Block Toeplitz Matrix

Try: rng(123) A = eye(3); B = randi(10,3); Omega = kron(A,B) gives: Omega = 7 6 10 0 0 0 0 ...

Create Block Toeplitz Matrix

Try: rng(123) A = eye(3); B = randi(10,3); Omega = kron(A,B) gives: Omega = 7 6 10 0 0 0 0 ...

7 days ago | 0

Answered

How to prepare a matrix with variables that contain a range of values?

syms c s x % Tsigma Tsigma = [c^2 s^2 2*c*s; s^2 c^2 -2*c*s; -c*s c*s c*2-s^2]; Tsigma = subs(Tsigma,[s, c],[sin(x), cos(x)...

How to prepare a matrix with variables that contain a range of values?

syms c s x % Tsigma Tsigma = [c^2 s^2 2*c*s; s^2 c^2 -2*c*s; -c*s c*s c*2-s^2]; Tsigma = subs(Tsigma,[s, c],[sin(x), cos(x)...

18 days ago | 0

Answered

Cubic funtion for interpolating

https://de.mathworks.com/help/matlab/ref/polyfit.html https://de.mathworks.com/help/matlab/ref/polyval.html

Cubic funtion for interpolating

https://de.mathworks.com/help/matlab/ref/polyfit.html https://de.mathworks.com/help/matlab/ref/polyval.html

18 days ago | 1

Answered

Plot multiple probability distribution function side by side

% My code is not giving me what I want. pd1 = makedist('Normal') pd2 = makedist('Normal',2,1) x = -10:.1:10; pdf_x = pdf(pd1...

Plot multiple probability distribution function side by side

% My code is not giving me what I want. pd1 = makedist('Normal') pd2 = makedist('Normal',2,1) x = -10:.1:10; pdf_x = pdf(pd1...

18 days ago | 0

| accepted

Answered

How to solve a linear system A * X = B when B and X are matrices instead as vectors?

linsolve can handle this. From documentation (Input Arguments): "...If B is a matrix, then each column in the matrix represents...

How to solve a linear system A * X = B when B and X are matrices instead as vectors?

linsolve can handle this. From documentation (Input Arguments): "...If B is a matrix, then each column in the matrix represents...

19 days ago | 0

Answered

I need to plot "e" by function of all values of "dm" i but can't do it please help

F=2000 ; dm=[12: 5: 37]; f=0.2 ; l=2 ; Q= ((F.*dm)/2)*((l+(pi*f.*dm)/((pi.*dm)-(f*l)))) ; e= (F*l)./(2*pi.*Q); % ^ ...

I need to plot "e" by function of all values of "dm" i but can't do it please help

F=2000 ; dm=[12: 5: 37]; f=0.2 ; l=2 ; Q= ((F.*dm)/2)*((l+(pi*f.*dm)/((pi.*dm)-(f*l)))) ; e= (F*l)./(2*pi.*Q); % ^ ...

19 days ago | 0

| accepted

Answered

How to calculate the area of only white part in the image

Same as in your question yesterday: regionprops will solve both problems in 1 line of code.

How to calculate the area of only white part in the image

Same as in your question yesterday: regionprops will solve both problems in 1 line of code.

19 days ago | 1

Answered

Error happen when doing optimization by using "surrogateopt"

f1 is a 2x1 vector - the objective of an optimization has to be a scalar. Thats the error. You need a criterion that expresses t...

Error happen when doing optimization by using "surrogateopt"

f1 is a 2x1 vector - the objective of an optimization has to be a scalar. Thats the error. You need a criterion that expresses t...

19 days ago | 0

| accepted

Answered

How to concatenate a (REAL) string vector?

A=["abcd","efghijk"; "lm", "opkq"] B = A(:,1) + A(:,2) The more general solution (independent from number of rows or columns o...

How to concatenate a (REAL) string vector?

A=["abcd","efghijk"; "lm", "opkq"] B = A(:,1) + A(:,2) The more general solution (independent from number of rows or columns o...

19 days ago | 0

| accepted

Answered

How to insert a cell with string into a table as variable

The solution is inside the error message: B is a cell array of strings specify names in a string array or cell array of cha...

How to insert a cell with string into a table as variable

The solution is inside the error message: B is a cell array of strings specify names in a string array or cell array of cha...

19 days ago | 0

| accepted

Answered

how to include a 'probability' when coding.

Use this every time you want to reward by random reward = rand(1) <= 0.6 reward = rand(1) <= 0.6 reward = rand(1) <= 0.6 rew...

how to include a 'probability' when coding.

Use this every time you want to reward by random reward = rand(1) <= 0.6 reward = rand(1) <= 0.6 reward = rand(1) <= 0.6 rew...

19 days ago | 2

| accepted

Answered

Which is the most efficient way to solve a ODE that has a parameter that changes in every period?

Are gamma and beta parameters that result from the gamma / beta functions? Or just scalar parameters? I suggest using other name...

Which is the most efficient way to solve a ODE that has a parameter that changes in every period?

Are gamma and beta parameters that result from the gamma / beta functions? Or just scalar parameters? I suggest using other name...

19 days ago | 0

| accepted

Answered

How to get certain matrix columns.

A = [1 2 3 4 5 6 7 8 9 10 11 12; 13 14 15 16 17 18 19 20 21 22 23 24] A1 = reshape(A',2,[]) b = A1(:,1:3:end) b = b(:)'

How to get certain matrix columns.

A = [1 2 3 4 5 6 7 8 9 10 11 12; 13 14 15 16 17 18 19 20 21 22 23 24] A1 = reshape(A',2,[]) b = A1(:,1:3:end) b = b(:)'

20 days ago | 1

| accepted

Answered

The end operator must be used within an array index expression.

See the original question - i fixed the error. frame = read(v,[600:600:end]); will not work in this case.

The end operator must be used within an array index expression.

See the original question - i fixed the error. frame = read(v,[600:600:end]); will not work in this case.

20 days ago | 1

| accepted

Answered

how to remove trailing zeros after rounding a matrix?

format short A = 1.23 format shortG A = 1.23

how to remove trailing zeros after rounding a matrix?

format short A = 1.23 format shortG A = 1.23

20 days ago | 0

Answered

How to extract a frame every 10 s from the video ?

https://de.mathworks.com/help/matlab/ref/videoreader.read.html#busxibt-2 In your case the interval to take the first frame afte...

How to extract a frame every 10 s from the video ?

https://de.mathworks.com/help/matlab/ref/videoreader.read.html#busxibt-2 In your case the interval to take the first frame afte...

20 days ago | 1

| accepted

Answered

matrix multiple rows with the same value

repmat([20:145:600],2,1)

matrix multiple rows with the same value

repmat([20:145:600],2,1)

20 days ago | 1

| accepted

Answered

not enough input argument error

timespan=[0 15]; y0 = [0 1 0 1 0 1]; [t,y] = ode45(@repressilator,timespan,y0); figure() plot(t,y) xlabel('Time') ylabel(...

not enough input argument error

timespan=[0 15]; y0 = [0 1 0 1 0 1]; [t,y] = ode45(@repressilator,timespan,y0); figure() plot(t,y) xlabel('Time') ylabel(...

20 days ago | 0

| accepted

Answered

Help: How to add a label (cell 1 x 20) to each bar (total 20 bars) in a bar plot where the bar plot has a 1x 2 dimension?

Try: labels=reshape({'A', 'B', 'C', 'D','E', 'F', 'G', 'D','A', 'B', 'C', 'D','A', 'B',... 'C', 'D','A', 'B', 'C', 'D'}',1...

Help: How to add a label (cell 1 x 20) to each bar (total 20 bars) in a bar plot where the bar plot has a 1x 2 dimension?

Try: labels=reshape({'A', 'B', 'C', 'D','E', 'F', 'G', 'D','A', 'B', 'C', 'D','A', 'B',... 'C', 'D','A', 'B', 'C', 'D'}',1...

20 days ago | 0

| accepted

Answered

How to calculate the center of white part?

Look at the regionprops examples.

How to calculate the center of white part?

Look at the regionprops examples.

20 days ago | 1