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

casi 4 años hace | 1

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

casi 4 años hace | 1

| aceptada

Respondida
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,...

casi 4 años hace | 1

| aceptada

Respondida
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],[],[]...

casi 4 años hace | 1

| aceptada

Respondida
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_...

casi 4 años hace | 2

| aceptada

Respondida
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

casi 4 años hace | 1

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

casi 4 años hace | 0

| aceptada

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

casi 4 años hace | 0

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

casi 4 años hace | 0

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

casi 4 años hace | 1

| aceptada

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

casi 4 años hace | 0

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

casi 4 años hace | 0

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

casi 4 años hace | 0

Respondida
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 ? ...

casi 4 años hace | 0

| aceptada

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

casi 4 años hace | 0

Respondida
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 = ...

casi 4 años hace | 1

Respondida
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];...

casi 4 años hace | 0

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

casi 4 años hace | 0

Respondida
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])

casi 4 años hace | 0

| aceptada

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

casi 4 años hace | 1

| aceptada

Respondida
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,...

casi 4 años hace | 0

| aceptada

Respondida
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(...

casi 4 años hace | 1

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

casi 4 años hace | 1

| aceptada

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

casi 4 años hace | 0

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

casi 4 años hace | 0

Respondida
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".

casi 4 años hace | 0

| aceptada

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

casi 4 años hace | 0

| aceptada

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

casi 4 años hace | 0

Respondida
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))...

casi 4 años hace | 1

| aceptada

Cargar más