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(:)'

alrededor de 8 horas 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.

alrededor de 9 horas 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

alrededor de 9 horas 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...

alrededor de 9 horas 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)

alrededor de 10 horas 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(...

alrededor de 11 horas 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...

alrededor de 11 horas ago | 0

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.

alrededor de 14 horas ago | 1

Answered

Error of sym>convertChar

syms a b c x f = str2sym('a*x^2 + b*x + c') subs(f,x,5) subs(f,[x a b c],[5 1 2 3])

Error of sym>convertChar

syms a b c x f = str2sym('a*x^2 + b*x + c') subs(f,x,5) subs(f,[x a b c],[5 1 2 3])

1 día ago | 1

Answered

Optimising parameters in ODE with fminsearch or fmincon and ode15s

I had to make some guesses, check how to adapt the code: a = fminsearch(@myObj,[300 0]); function obj = myObj(a) % only one...

Optimising parameters in ODE with fminsearch or fmincon and ode15s

I had to make some guesses, check how to adapt the code: a = fminsearch(@myObj,[300 0]); function obj = myObj(a) % only one...

1 día ago | 0

Answered

How to solve a cubic equation using Genetic Algorithms?

start here: https://de.mathworks.com/help/gads/ga.html?searchHighlight=ga&s_tid=srchtitle#mw_a07ddf7d-face-4243-a656-f1528b592d...

How to solve a cubic equation using Genetic Algorithms?

start here: https://de.mathworks.com/help/gads/ga.html?searchHighlight=ga&s_tid=srchtitle#mw_a07ddf7d-face-4243-a656-f1528b592d...

1 día ago | 0

Answered

Solving an ODE second order

change to the initial conditions as you need: % symbolic variables syms a b y(x) % Define derivatives Dyx = diff(y,x,1) D2y...

Solving an ODE second order

change to the initial conditions as you need: % symbolic variables syms a b y(x) % Define derivatives Dyx = diff(y,x,1) D2y...

1 día ago | 0

| accepted

Answered

tan(x) graph

I guess you know that your picture is not a tan function... fplot(@tan,[0 7],'LineWidth',2)

tan(x) graph

I guess you know that your picture is not a tan function... fplot(@tan,[0 7],'LineWidth',2)

1 día ago | 0

| accepted

Answered

Detection of parts of circles (shape detection)

I dont think that this is correct: "...sometimes the lense is fully in the picture and sometimes not, which makes circle detecti...

Detection of parts of circles (shape detection)

I dont think that this is correct: "...sometimes the lense is fully in the picture and sometimes not, which makes circle detecti...

1 día ago | 0

Answered

Solving equation with symbolic vector variable

use the dot-notation a = [1 2 3 4]; x = sym('x', [1 4]); eqn = a + 4.*x == x; sol_x = vpasolve(eqn, x) sol_x.x1 sol_x.x2 ...

Solving equation with symbolic vector variable

use the dot-notation a = [1 2 3 4]; x = sym('x', [1 4]); eqn = a + 4.*x == x; sol_x = vpasolve(eqn, x) sol_x.x1 sol_x.x2 ...

2 días ago | 1

| accepted

Answered

Splitting time into hours : minutes : seconds from a fractional value.

I guess 15.76 means hours in decimal numbers: [h,m,s] = hms(hours(15.76)) d = duration(h,m,s) gives: h = 15 m = ...

Splitting time into hours : minutes : seconds from a fractional value.

I guess 15.76 means hours in decimal numbers: [h,m,s] = hms(hours(15.76)) d = duration(h,m,s) gives: h = 15 m = ...

3 días ago | 0

| accepted

Answered

Why linsolve cannot solve this very simple equation?

To solve this, the rank should be 3. Row 1 and 3 are not linear independent. A = [4,2,2; 5,1,3; 6,0,4] B = [60; 70; 80]; r1...

Why linsolve cannot solve this very simple equation?

To solve this, the rank should be 3. Row 1 and 3 are not linear independent. A = [4,2,2; 5,1,3; 6,0,4] B = [60; 70; 80]; r1...

3 días ago | 0

| accepted

Answered

Why find cannot handle this very simple task?

You are dealing with doubles, they are not precisly 0.077 - use round: X = -0.1:.001:.25; find(round(X,3) == .077)

Why find cannot handle this very simple task?

You are dealing with doubles, they are not precisly 0.077 - use round: X = -0.1:.001:.25; find(round(X,3) == .077)

3 días ago | 0

Answered

Storing datetime double in a table

%%%Set this to desired sheet sheet = 'Test'; %Sets Date time format for when table is read opts = detectImportOptions("Weat...

Storing datetime double in a table

%%%Set this to desired sheet sheet = 'Test'; %Sets Date time format for when table is read opts = detectImportOptions("Weat...

3 días ago | 1

Answered

step respone, impulse response

s=tf('s'); kb=52; k1=156; k2=53; G1=10/(s+0.01); G2=G1/(1+kb*G1); G3=G2*k2*k1; G4=G3/(G3+1); subplot(2,1,1) impulse(G...

step respone, impulse response

s=tf('s'); kb=52; k1=156; k2=53; G1=10/(s+0.01); G2=G1/(1+kb*G1); G3=G2*k2*k1; G4=G3/(G3+1); subplot(2,1,1) impulse(G...

4 días ago | 0

Answered

How can I do such a "countifs"(excel) process in Matlab?

You do it by logical indexing: A = randi(10,1,15) CountIf = numel(A(A>5)) gives: A = 9 7 4 10 1 5...

How can I do such a "countifs"(excel) process in Matlab?

You do it by logical indexing: A = randi(10,1,15) CountIf = numel(A(A>5)) gives: A = 9 7 4 10 1 5...

4 días ago | 1

Answered

Dijkstra's Algorithm

You could make life easier using Matlab inbuilt graphs functions. One example is <https://de.mathworks.com/help/matlab/ref/graph...

Dijkstra's Algorithm

You could make life easier using Matlab inbuilt graphs functions. One example is <https://de.mathworks.com/help/matlab/ref/graph...

4 días ago | 0

Answered

How to find the sum of duration if the consecutive row elements are the same?

Save the durations you calculated using *|diff|* in an additional column so that the durations are correct for every row in your...

How to find the sum of duration if the consecutive row elements are the same?

Save the durations you calculated using *|diff|* in an additional column so that the durations are correct for every row in your...

4 días ago | 0

Answered

How can i sum up 56-year daily precipitation data from APHRODITE (netcdf file) into monthly?

If you organize your data in a timetable you can use retime to sum up monthly.

How can i sum up 56-year daily precipitation data from APHRODITE (netcdf file) into monthly?

If you organize your data in a timetable you can use retime to sum up monthly.

4 días ago | 0

Answered

Generate new column from cumulating another

A = (1:4)' A(:,2) = cumsum(A) gives: A = 1 2 3 4 A = 1 1 2 3 3 ...

Generate new column from cumulating another

A = (1:4)' A(:,2) = cumsum(A) gives: A = 1 2 3 4 A = 1 1 2 3 3 ...

4 días ago | 1

| accepted

Answered

mathematical expression from string input

https://de.mathworks.com/help/symbolic/str2sym.html >> fun = str2sym("(sin(sqrt(x)+a) * e^sqrt(x)) / sqrt(x)") fun = (e^...

mathematical expression from string input

https://de.mathworks.com/help/symbolic/str2sym.html >> fun = str2sym("(sin(sqrt(x)+a) * e^sqrt(x)) / sqrt(x)") fun = (e^...

4 días ago | 1

| accepted

Answered

Solve formal equation and get the solution with these variables

syms i1 i2 ib v1 v2 hie hre hfe hoe hfb eqns(1) = i1==-ib-hfe*ib+(v1-v2)*hoe; eqns(2) = i2==hfe*ib+(v2-v1)*hoe %ib==-v1/hie...

Solve formal equation and get the solution with these variables

syms i1 i2 ib v1 v2 hie hre hfe hoe hfb eqns(1) = i1==-ib-hfe*ib+(v1-v2)*hoe; eqns(2) = i2==hfe*ib+(v2-v1)*hoe %ib==-v1/hie...

4 días ago | 0

| accepted

Answered

Importing a table with unknown number of rows

I dont think it is needed to specify this, using readtable function. I never used this option to import a .csv-file as table in ...

Importing a table with unknown number of rows

I dont think it is needed to specify this, using readtable function. I never used this option to import a .csv-file as table in ...

5 días ago | 0

| accepted

Answered

Problem with solution seemingly simple linear system of equations [0x1 sym]

rewriting the system to matrix shows that this system has no solution, due to inconsistence: d=32; %mm - Srednica tłoka p1=0.5...

Problem with solution seemingly simple linear system of equations [0x1 sym]

rewriting the system to matrix shows that this system has no solution, due to inconsistence: d=32; %mm - Srednica tłoka p1=0.5...

5 días ago | 0

| accepted