Beantwortet
error using inlineval, error unexpected MATLAB expression
syms x f = log(3*x+1) g = diff(f,x)

fast 4 Jahre vor | 1

Beantwortet
Why this code doesn't work?
ti=0.0; tf=15.0; ui=30.0; m=2585; g=10; W=m*g; Theta=0.0; Fx=-2000; f=0.03; rho=1.225; Cd=0.2; A=2.9; uw=0.0; tol=1.0E-4; tra...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
Triple integers (cylindrical method)
lower_z = @(r,theta) 0.5*r.^2.*sin(theta).*cos(theta); upper_z = @(r,theta) r.*sqrt(cos(theta).^2+2*sin(theta).^2); fun = @(r,...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
Errors with fmincon in Matlab script
[x,fval] = fmincon(@(x)system2(x(1),x(2)),[2;3.5],[],[],[],[],[1;2],[3;5]) instead of [x,fval] = fmincon(system2,[2;3.5],[],[]...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
implementation of the bisection method
%fixed inputs c=25.8972; b=0.0320; a=0.7535; R=0.0821; Vc=0.1951; % Generate 30 artificial (Pstar,T) pairs to test Pstar_...

fast 4 Jahre vor | 2

| akzeptiert

Beantwortet
diffuclt to write the su of a number
s0 = 0.5; s = 0; for i=1:1000 s=s+s0; end disp('the sum is: '),s disp('compare with:'),1000*s0

fast 4 Jahre vor | 1

Beantwortet
Array indices must be positive integers or logical values.
f is interpreted here as an array, and arrays can only be indexed with positive integers or logical values. So f(-6) is forbidd...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
The usual way to define a function is function [output1,output2,...] = name_of_the_function(input1,iput2,...) Your line of...

fast 4 Jahre vor | 0

Beantwortet
Divided difference in Newton's form error
Whatever your code is supposed to do, add a sixth element to the vector "a" in function "dd": a = [-5, 2, -4, 8, 3, 6]; instea...

fast 4 Jahre vor | 0

Beantwortet
sorting vector by value and position
A = [109 97 116 108 97 98]; [~,p] = sort(A,'ascend'); r = 1:length(A); r(p) = r

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
Optimoptions - Invalid solver specified error
You wrote 'StepToleance' instead of 'StepTolerance' ...

fast 4 Jahre vor | 0

Beantwortet
Find x and y cordinates and t for z=0
xvel=20; yvel=20; zvel=40; g=-9.80665; t = [0:0.1:10]; xacc = 0; yacc = 0; zacc = g; sx = xvel*t + (0.5 * xacc*t.^2); s...

fast 4 Jahre vor | 0

Beantwortet
Error using plot Vectors must be the same length.
Replace mf = [mf1 mf2 mf3]; by mf = [mf1; mf2; mf3];

fast 4 Jahre vor | 0

Beantwortet
Calculate the next 2 numbers in the sequence
u_(n+2) = 4*u_(n+1) + 2*u_n If you insert n = 0, you get u_2 = 4*u_1 + 2*u_0 So what is u_2 given that u_0 = 3 and u_1 = 2 ? ...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Trying to find the Euclidean distance of 2 vectors with different sizes
T =[5.1000 3.5000 6.4000 3.2000 5.4000 3.4000 5.7000 2.8000 5.7000 4.4000 5.6...

fast 4 Jahre vor | 0

Beantwortet
Function for ODE45 requires all coefficients be written in it
tspan = linspace(0,35,35000); f0 = [1; 1; 1; 1; 1; 1; 1; 1]; a = 2; g_p = 3; g_s = 105; g_a = 0; g = 1; k = 250; P = 0; O_z = ...

fast 4 Jahre vor | 1

Beantwortet
Making a horizontal region between two functions
f = @(x) x.^3; g = @(x) x.^(1/3); a = 0; b = 1; hold on fplot(f,[a,b]) n = 20; for i = 1:n+1 start = [g((i-1)/n*b),1];...

fast 4 Jahre vor | 0

Beantwortet
Set initial condition to time different to 0
This is a boundary value problem, not an initial value problem. Thus you should use bvp4c instead of ode45.

fast 4 Jahre vor | 0

Beantwortet
Finding the minimizer using fminunc.
fv = @(x) x(1)^2 + x(1)*x(2) + (3/2)*x(2)^2 - 2*log(x(1)) - log(x(2)); [minimizer,minimum_value] = fminunc(fv,[1; 1])

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Testing if Data is close to the Exponential Distribution
How can I take this data and see if it is exponentially distributed? There is no way to do so. Also, how can I find how far t...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
Nonlinear equations with two variables and a changing parameter
%The below is a system of nonlinear equations with two variables x, t, and %a changing parameter V. 0<x<0.2, t is around 6.3e6,...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Solving a system of equations using the solve function in a for loop?
Remove all the (t) in the symbolic variables, so use syms q TPCM Toil_PCM_to_EG instead of syms q(t) TPCM(t) Toil_PCM_to_EG(...

fast 4 Jahre vor | 1

Beantwortet
How to fit parameters of an ode by using ode45 and fmincon
Check your differential equations. As you can see, the derivatives for the given constellation (parameters and initial condition...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
Solve Command giving wrong numbers for certain values, but gives perfect answers for the rest?
As you can see, there are two solutions for angle_3 and angle_4. Seems you took the wrong one for 290-330 degrees. syms angle_2...

fast 4 Jahre vor | 0

Beantwortet
3 state space model time discretization
x_dot = A*x + [B,C]*[u;v] So define A_ss = A, B_ss = [B,C]

fast 4 Jahre vor | 0

Beantwortet
Steady-state solution for system of parabolic PDEs?
Since this gives a system of second-order ODEs in general, the usual code to try would be "bvp4c".

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Fitting curve of curve with parametric representation to measured data
opt = fmincon(@(S)Fehlerberechnung_Kreisevolvente(S(1),S(2),S(3),S(4)), [2,0,0,0]) instead of opt = fmincon(@(S)Fehlerberechnu...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
When coding of function that shows error in yellow underline.
If f is a function handle, this line of your code doesn't make sense: if fc > f Only the result of function handles applie...

fast 4 Jahre vor | 0

Beantwortet
Getting A blank Graph
I changed y3 to what I think you meant. x=0:0.01:1; y1=(0.5*x.^5)-(0.6*x.^4)-(0.6*x.^3)+(0.3*x.^2)+0.25; y2=(sin(x).*cos(x))...

fast 4 Jahre vor | 1

| akzeptiert

Mehr laden