Beantwortet
Find nth value in a matrix and plot on graph
Run = 6; i72=zeros([max(Run) 1]); i68=i72; i62=i72; i58=i72; i22=i72; i18=i72; i12=i72; i08=i72; for i = 1:Run if i==1 ...

fast 3 Jahre vor | 0

Beantwortet
In an assignment A(:) = B, the number of elements in A and B must be the same. How can I fix this error?
For Run = 1, you get empty results for i72(1),i68(1),.... But i71(1),i68(1),... cannot be removed from the 2x1 arrays i71, i68,....

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
how to index the stating position of something?
x1 = [1 0 2 3 8 5 6 7 0 0 0 0 0 2 5 3 0 0 6 4]; out1 = LengthAndPosnZeros(x1) x2 = [1 0 0 8 5 0 0 3 3 3 3 0 0 0 0]; out2 = ...

fast 3 Jahre vor | 0

Beantwortet
I have an error in my program. the error is about 'Error using letter_detection (line 4) Not enough input arguments.' using Matlab R2015A and I named the file letter_detection
You should test the procedure with a simple example: Write a function function s = addition(a,b) s = a+b; end and save it...

fast 3 Jahre vor | 0

Beantwortet
I do not understand exit message given by lsqnonlin,
Should be function [c,ceq] = myNonlinearConstraints(x) V_sim= evalin('base','V_sim'); Vsim_max = max(V_sim); c(1) = x(...

fast 3 Jahre vor | 2

Beantwortet
solution of a system of PDEs with finite difference method and runge kutta second order
Where is the x in your equations ? I only see differentiation with respect to t. And shouldn't the 2nd order differentiation in ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
I don't know how to include specific conditions in my code
a = [0 0 9 0; 0 0 1 8; 0 0 4 0; 0 0 2 3; 0 6 7 5]; z = lastzerorow(a) function z = lastzerorow(a) ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Finite difference method for a system of pde
These kind of transformations are usually made to transform a system of PDEs to a system of ODEs that can be solved more easily....

fast 3 Jahre vor | 0

Beantwortet
How to solve PDE with second order in the time derivative in Matlab?
You could try du/dt = v (1+t^2)*dv/dt +t*v = (1+x^2)*d^2u/dx^2 + x*du/dx du/dx = dv/dx = 0 at x = 0 % dv/dx = 0 is artifici...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
I'm trying to do harmonic analysis, but it says that the t_get18consts function is not defined.
From https://www.eoas.ubc.ca/~rich/ (2019) I've modified v1.3b by running it through the matlab editor and fixing a lot o...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Solving linear systems in Matlab
x = A\(u-A*b) But it's the same as x = A\u - b

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Efficient searching to find the first element of an array meeting a condition
"find" will use the "first" option by default which means that the command will return the first occurence of the event and will...

fast 3 Jahre vor | 0

Beantwortet
Plot multiple graph after solving
syms y t g f1 = -2*g*t.^3/((1 - y).^(1-2*g)) + 2*g*(3 - t.^2)^2./((2 - t).*y.^(1-2*g)) + (8*g*t)./(y.^(1-2*g)) - 2*g*(3 - 2*t)....

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Nested Numerical Integration with multivariable functions
d=.01; %1/e patch diameter; D=.35; %Aperture Diameter L=7e3; %Propagation distance; coeff=-11.64*(16/pi)^2*D^(-1/3); fun = ...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to handle interface boundary condition in convection-diffusion reaction equation for pressure, velocity and concentration equation?
If the interface conditions are continuity of the variable and the flux, the finite element method will automatically respect th...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to obtain an array of the indices from the original array when using nchoosek
You better get B from C, not C from B: A = [7, 8, 9]; v = 1:numel(A); C = nchoosek(v,2) B = A(C)

fast 3 Jahre vor | 1

Beantwortet
How to find the intersection values of line and curve?
https://uk.mathworks.com/matlabcentral/answers/2009582-how-to-find-the-intersection-values?s_tid=srchtitle

fast 3 Jahre vor | 0

Beantwortet
Integration with multiplication of whittaker and bessel function
MATLAB is not able to get an explicit antiderivative for "kr_real". That's why "int" returns the integral expression unchanged -...

fast 3 Jahre vor | 0

Beantwortet
How do I fit two function in a same data at a time depending on the range ?
t = load("t.mat"); t = t.t; y = load("y.mat"); y = y.y; value_min = Inf; for i = 1:numel(t) fun1 = @(time)time.^2; ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
problem with fmincon: constraints are not satisfied
You cannot define your constraints in the objective function. Thus "c" and "ceq" are not used by "fmincon". To account for them,...

fast 3 Jahre vor | 1

Beantwortet
Averaging data from seconds to three seconds because of different time variables
I'd repeat the data for 3 seconds three times. This does not manipulate your data with interpolation or averaging.

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Plotting the outcome of a 3D fit
x = 0:0.1:1; y = -1:0.1:1; [X,Y] = meshgrid(x,y); Z = X.^2+Y.^2+0.1*(-1+2*rand(size(X))); [Xout,Yout,Zout] = prepareSurfaceD...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Goodness of fit for weibull distribution
https://www.spcforexcel.com/knowledge/basic-statistics/deciding-which-distribution-fits-your-data-best https://stats.stackexcha...

fast 3 Jahre vor | 0

Beantwortet
How can I generate a vector like this 1,2,2,3,3,3,4,4,4,4 by using for loop?
Start with y = [] and in each step of the for-loop running from 1 to n, concatenate y and i*ones(1,i).

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Hello, I have problem with odeToVectorField in ODE second order system of equations.
dydt = fun(0.1,ones(12,1)).' function dydt = fun(t,y) g= 9.81; m= 0.468; Ix= 4.856e-3; Iy= 4.856e-3; Iz= 8.801e...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Why am i getting the error 'The first input to exist must be a string scalar or character vector' while solving 4 ode using ode45 solver ??
ode45 is a numerical integrator. It doesn't accept symbolic inputs. b = deg2rad(45); tspan = [0 pi]; y0 = [0.10 3.14e-06 1.4...

fast 3 Jahre vor | 0

Beantwortet
How to find the intersection values?
format long d1 = 0.4;d2 = 0.6;d = d1 + d2; n1 = sqrt(12);n2 = 1; D1 = @(lambda)(2*pi*n1*d1)./lambda;D2 = @(lambda)(2*pi*n2*d2...

fast 3 Jahre vor | 0

Beantwortet
2nd order differential equation with two 1st order differential equations boundary condtions
This is the code for the equation and boundary conditions you posted: xmesh = 6:0.005:6.5; solinit = bvpinit(xmesh, [6.55 0.57...

fast 3 Jahre vor | 0

| akzeptiert

Mehr laden