Beantwortet
Thomas algorithm - tridiagonal matrix
clear cm=1/100; delta = 1*cm; nu=1e-6; Uinf=1; H=2*delta; y=linspace(0,H,40); u=Uinf*erf(3*y/delta); dy=mean(diff(y)); ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Why the function like (1 - cosd(x)) / cosd(x) doesn't create an vector and can't plot?
%sin und cos in degree sind sind() und cosd() F_rel_a = (R - sind(x))./sind(x) F_rel_c = (1 - cosd(x))./cosd(x) instead of %...

mehr als 3 Jahre vor | 0

Beantwortet
Error with my MATLAB code
E0 and Es are undefined. syms t s Gs Gt Ks Es Et MSU1 = readtable('Relaxation data.xlsx','Range','A4:E82'); E00 = 8567.19; v...

mehr als 3 Jahre vor | 0

Beantwortet
lsqcurvefit help: Error using asset. FUN must have two input arguments.
Replace the line v_hat = @(A_v,w_g,w_l) A_v.*exp(-(w_g.^2*k_p.^2)/(16*log(2)) - (w_l.*abs(k_p))./2); by V_hat = @(A_v,w_g,w_l...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
In this code, I want to find out slope at every value of x?
The answer doesn't change because of new x/y data: clear all clc x=[10.33 10.331 10.332 10.333 10.334 10.335 10.336 10.337 10...

mehr als 3 Jahre vor | 0

Beantwortet
How to get complete curves in a plot?
clc clear %discretize the space based on uniform spacing(eta) eta = 0.02; N = 300; %specific the slope of second derivative...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How can I run these codes in a for loop?
for i = 0:4 idx(i+1) = hour(result.HourSeries1)==strcat('0',string(i)); m(i+1) = mean(Climatology1.H1(idx(i+1),:)); e...

mehr als 3 Jahre vor | 0

Beantwortet
solve constraint optimization problem
x = optimvar('x'); prob = optimproblem; M=[1 x;x 1+2*x]; prob.Objective = norm(M,'fro')^2; prob.Constraints.cons1 = x^2-2*x ...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to put value from one matrix into another matrix
A = [3:42;rand(1,40)].'; B = [6 45 18 24 33;5 12 17 23 32;4 11 16 22 31;3 10 15 21 30]; result = zeros(size(B)); for i = 1:...

mehr als 3 Jahre vor | 0

Beantwortet
add conditional constrain in optimization
Define x_it be the decision variable if pump i is active at time t. That means x_it can take values 0 and 1 and equals 0 of pump...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Finding all the positive Roots of non linear equation and plotting the modes
f = @(k) cos(k).*cosh(k)+1; K = 0:0.1:8; plot(K,f(K)) k(1) = fzero(f,[1 4]) k(2) = fzero(f,[4 5]) k(3) = fzero(f,[5 9]) Th...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
solve equation for a variable
You don't need a toolbox for this. Take a piece of paper and a pencil, multiply the equation by the denominator of the left-han...

mehr als 3 Jahre vor | 0

Beantwortet
How to put value from one matrix into another matrix
help reshape Or are the entries of the matrix B not necessarily as regular as in your picture ? A = [1 2 3 4 5 6 7 8;0.2 0.8 0...

mehr als 3 Jahre vor | 0

Beantwortet
At every value of x, how measure slope of plot?
Look at the approximate slope curve under https://de.mathworks.com/matlabcentral/answers/1919960-how-can-i-interpolate-x-and-y-...

mehr als 3 Jahre vor | 0

Beantwortet
How can I interpolate x and y data points in plot and slope (dy/dx) at any value of x?
x=[15 20 25 30 35 40 45 50 55]; y=[11.89 11.845 11.85 11.855 11.865 11.93 12.01 12.2 12.77]; % Approximate dy/dx dy = gradien...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Modeling using 6 differential equation and a constraint?
v = FT*0.082*T/P = sum(dydVol)*0.082*T/P = 1/v*sum(dydVol*v)*0.082*T/P -> v^2 = sum(dydVol*v)*0.082*T/P Thus define the d...

mehr als 3 Jahre vor | 0

Beantwortet
Index must not exceed 10, but why???
If dt is an array of length 10, then "n" in the loop "for j = 1:n" must be <= 10 since you try to access dt(j). Is this the ca...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to save a vector from each iteration in a loop in a matrix?
output_all(:,i) = output(1,:).'; instead of output_all(:,i) = output(1,:);

mehr als 3 Jahre vor | 0

Beantwortet
No solution found. fsolve stopped because the relative size of the current step is less than the value of the step size tolerance squared
q=1.6e-19; kb=1.38e-23; T=300; phit=(kb*T)/q; % Ilgt=20e-3; % Irevsat=1.98e-15; rshunt=1e3; rseries=10; n=1; V_array=-1...

mehr als 3 Jahre vor | 3

| akzeptiert

Beantwortet
Minimize a function with equality, inequality, and product in constraints
x2,x3,x5 and x7 are all >= 0. Thus the constraint (x5+x2)*(x3+x7) = 0 either gives x5=x2=0 or x3=x7=0. Thus use "linprog" twi...

mehr als 3 Jahre vor | 1

Beantwortet
how to iterate cell array?
all_N1 = cell(51,1); % Generate 100 matrices of size 20x20 and save them in cell array for i = 1:100 all_N1{i} = rand(20); ...

mehr als 3 Jahre vor | 0

Beantwortet
Solving an eq. using a large table by vpasolve is to slow
syms A.var1 A.var2 A.var3 A.var4 X Equation = ((A.var1 -c1*X^4)- (c2*A.var2*(6.105.*exp((c3*X)./(X+c4)) -A.var3)) - (c5*(X-A.v...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Solving matrix differential equation
I took R10, R20 as initial conditions for your matrix equations. I formed W1, W2 with the matrices R1 and R2 at time t. You for...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
subs() in symbolic chain rule outpus incorrect derivative?
The below looks fine to me. Which MATLAB version do you use ? syms x y(x) f(a,b) Df = diff(f(x,y(x)),x) Df = subs(Df,diff(y(x...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Approximating parameters with ODE, error using vertcat dimesions of arrays being concatenated are not consistent
If you debug your code, you will see that c has dimension 1x12 while theta has dimension 1x11 in the function "fhat". Thus the...

mehr als 3 Jahre vor | 0

Beantwortet
why do i get an error saying not enough input arguments for this code using bvp4c? it also says there is an error in dYdx(1)=Y(2)
solinit=bvpinit(x,[0;0;0;0;1;0;1;0]); instead of solinit=[0;0;0;0;1;0;1;0]; and sol=bvp4c(@bvp_func,@boundary_conditions,sol...

mehr als 3 Jahre vor | 1

Beantwortet
Problems using Linear Regression and syntax
For the Antoine equation, you usually work with log10: T = [273.15; 300.00; 310.00; 320.00; 330.00; 340.00; 350.00; ...

mehr als 3 Jahre vor | 0

Beantwortet
Please, help to find a mistake in the code for double integral
n = 1 ; t = 1; k = 1; %(k is ksi in formula) s = 0:0.5:20; fun = @(x,q,p) ((x.*exp(2*n*t.*(x.^2)))./sqrt(1-x.^2)).*(exp(-2*t...

mehr als 3 Jahre vor | 0

Beantwortet
MATLAB giving me a 16x1 complex double answer?
Replace syms w h by syms w h real positive

mehr als 3 Jahre vor | 0

Beantwortet
How do I plot 5e^(0.5t)sin(2*pi*t)
Note that sin(2*pi*t) = 0 for t = 0,1,2,3,...,10. And these are the only points for t you specified.

mehr als 3 Jahre vor | 1

Mehr laden