Beantwortet
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...

fast 2 Jahre vor | 1

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

fast 2 Jahre vor | 0

Beantwortet
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...

fast 2 Jahre vor | 0

Beantwortet
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.

fast 2 Jahre vor | 0

Beantwortet
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 ...

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
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^...

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Integration using trapz method
1 missing bracket and you missed to define dx: d = 30; E0=8.85e-12; c=.1; dx = 0.1; a = 0; b = 1; x = a:dx:b; N = lengt...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Meshgrid fo variables in complex equation
You might want to try fimplicit3: syms f(x,y,z) f(x, y, z)=2*x+3*y+4*z==0 fimplicit3(f) or an even more complex example: f(...

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
Define vector v in the code
v=[2,-3,-5,6] result = prod(v(v>0))

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to split an cell array of two numbers into two columns
YouWant = [m5{:}]'

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to calculate matrix M*T=T
syms T2 T3 M = [1., 0, 0, 0;... 0.5, 0, 0.5, 0;... 0, 0.5, 0, 0.5;... 0 0 0 1.] T = [500; T2; T3; 300] B =...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
how would i change an undirected network into a directed network on matlab?
here is a small example: A = [0 0 1; 0 0 1; 1 1 0] ug = graph(A) B = zeros(size(A,1)) B = B + triu(A) dg = digraph(B) ...

fast 2 Jahre vor | 1

Beantwortet
Simplify a symbolic expression
syms s T=21.0325 L=3.5890 X=(0.6*T)*((s+(1/L))^2)/s vpa(expand(X),10)

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
which optimization method should I use?
Following your statements surrogateopt appears to be the correct choice.

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Invalid array indexing. column 19.help
epsilon(i)(xi2(i)((1-epsilon(i)) is not allowed in Matlab, do you mean?: epsilon(i)*(xi2(i)*((1-epsilon(i))

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
Matlab Code (Reinforcement Learning in Finance by Alex Roumi, MathWorks)
The code has never been published. Usually the code used in webinars is published at file exchange, but this was a presentation ...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Error using horzcat:: Dimensions of array being concentenated are not consistent
There are 2 times the same values at different indices. To get only the first occourence: S=[.2046e17 .1381e17 .9249e17;.1679e1...

fast 2 Jahre vor | 0

Beantwortet
How do i create a "Cut" at origin?
A = 5; M = 0.8; w = 1.2; fi = 30; t2 = 20; firad = fi*pi/180; t = linspace(0,t2,1000); y = M + A*sin(w.*t + firad); ...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Creating matrix with diag command
This is how a normal Matlab user would so this z = diag(1:10) z = 1 0 0 0 0 0 0 0 0 ...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
not enough input data
Note that i used the same function for step2 like step1 to make it work - replace step2 with the correct function. Also i assume...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
function 'step'.
step(ss(A,B,C,D))

fast 2 Jahre vor | 0

Beantwortet
Getting lowest postive number in array with it's index
S=[-6.3e7 -0.0001e7 inf;5.2545 -.2996e7 inf] m_idx = [min(S(S>0)), find(S==min(S(S>0)))]

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Changing values in atable
% Example table with random data T = splitvars(table(randi(10,10,5))) T = 10×5 table Var1_1 Var1_2 Var1_3 ...

fast 2 Jahre vor | 0

Beantwortet
Is it possible to change the number of hidden layer in nprtool?
It is - indirectly - use patternet and then use a vector as input: net = patternnet(10); view(net) or if you need more hidden...

fast 2 Jahre vor | 0

Beantwortet
ODE 45 step size changes the turning point
This is not a problem of Matlab, but to the misunderstanding how ode solvers in Matlab work. Read here: https://de.mathworks.co...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Check for missing argument or incorrect argument data type in call to function 'log'.
Für mich funktioniert es, wenn ich numerische Werte für die Variablen definiere: TP = 500; RP = 200; PP = 201; EPS = 100; A...

fast 2 Jahre vor | 0

Beantwortet
How do i plot this equation in the time domain
see what this does: t = 0:0.01:2*pi; also read about function handles in Matlab: fun = @(t) 5 * (1 + K * m) .* cos(2*pi.*t) ...

fast 2 Jahre vor | 0