Answered
how to plot a periodic function fro negative to positive?
Hi @Daniel Niu Are you looking for this? Edit: Made changes as per shown in your diagram. Because the amplitude is unknown, th...

1 month ago | 0

Answered
How to plot function f(x,y,z)=c ?
@Duong Nguyen Not how it looks. Are you expecting something like this? c = pi/2; z = @(x, y) acos(c - cos(x) + cos(y)); fsur...

1 month ago | 0

Answered
I'm not getting the correct result for the u, i want it in degree but the ans is not right, the plot is not smooth.
To understand why it is not smooth, you need to see what causes the singularity (division-by-zero) at around . ni = 1; nt = 1....

1 month ago | 0

Answered
function that applies the parabolic interpolation method
Hi @Miftahul Jannah, Can you provide the parabolicmin.m file? help parabolicmin By the way, you should be able to visually de...

2 months ago | 0

| accepted

Answered
How to convert the following mathematica code to Matlab?
Hi @Md Fayaz Ahamed Identify the type of problem at first. If the problem is non-stiff, use ode45. Miscellaneous examples are p...

2 months ago | 0

Answered
How to find position function with acceleration function using matlab
Hi @ijsonvjksrefdsb This ordinary differential equation is a linear type. So, it is actually a kind of eigenvalue/eigenvector p...

2 months ago | 0

Answered
How do you design an adaptive PID controller/compensator for a Gimbal System? (taking in angle, accel, torque from reference)
Hi @Michael Ray Maligro If you asking how to design PID in MATLAB or Simulink, you need to have the mathematical model of the G...

2 months ago | 0

Answered
Determine the reward value to stop training in RL agent
Hi @Haitham M. There is an option to set the StopTrainingValue.

2 months ago | 0

Answered
State Variable of the Memristor
Hi @vani If you are talking about modeling the memristor and running a simulation in MATLAB, then I think you can use ode45(). ...

2 months ago | 0

| accepted

Answered
Problem with minimizing a LQR problem with Genetic Algorithm
Hi @gilad shaul To find through , you need to expand the Continuous-time Algebraic Riccati Equation (CARE) in terms of , and t...

2 months ago | 1

Answered
Calculating Value of Inverse function
Hi @Johan Ahlberg How about this? syms x f(x) = (x^2)/(1 + sqrt(x)); g = finverse(f) double(g(2))

2 months ago | 0

Answered
the curve in matlab
Hi @randino Not sure what you really want. Perhaps you want to get the "Validation" plot using the plotperform() command? x ...

2 months ago | 0

Answered
How to create a transfer function with no simplification ?
Hi @Dimosthenis Leonidas, The zpk() command shows the zero/pole/gain model. (), , and () are not in pole forms. If the native ...

2 months ago | 2

Answered
Problem with minimizing a LQR problem with Genetic Algorithm
Hi @gilad shaul Minimizing the norm(P) does not work because there are infinite K that can make A'*P + P*A - K'*R*K + Q exactly...

2 months ago | 1

| accepted

Answered
Hello, I am trying to numerically solve the following differential equation but unable to get a solution.
Hi @David M, If you are looking for a numerical solution, then the ode45() command is used. No = 1; So = 0.9999; ga...

2 months ago | 0

Answered
cantilever beam matlab equation solve
Hi @영범 곽 The function seems to have no real roots. Please check the trigonometric function again if something is missed. k = 2...

2 months ago | 0

| accepted

Answered
How do you appropriately integrate time steps to a while loop program for a single stage model rocket?
Your code runs, but I suspect that something is wrong in your Rocket Model. Does the line return the pitch angle in degree or r...

2 months ago | 0

| accepted

Answered
Unrecognized function or variable
Hi @Aysel Alimirzayeva It requires Robust Control Toolbox, the function is introduced in R2020a. Since yours is R2019b, then I ...

2 months ago | 0

| accepted

Answered
MatLab codes for the used by forensics to determine the exact time of death.
Hi @Evalistus Simon The equation derived from Newton's Law of Cooling is given by The ambient temperature is 70°F. Suppose t...

2 months ago | 1

Answered
Write MATLAB code to solve the following the minimum problem.
Hi @Chihiro Ogino You are advised to do some reading on the PSO algorithm to understand the code. % Step 1: Initialize PSO Xm...

2 months ago | 0

Answered
L’Hospital’s rule
Probably more clearly for you if you insert the expression directly syms x limit((x + 2)/(x^2 + 3*x + 2), -2)

2 months ago | 0

Answered
Help me drawing graph
Hi @현범 장 Here there is fimplicit(@(x,y) x + y - 5)

2 months ago | 0

| accepted

Answered
ode45 giving incorrect result
Hi @Joseph Billips There were errors in your code when you attempt to describe the dynamics of the pendulum, which is a 2nd-ord...

2 months ago | 0

Answered
Modelling ODE in Simulink when input multiplied by ouput
Hi @aizo zeo The given ODE cannot be modeled in the Laplace transform sense because it is a non-affine system due to the produc...

2 months ago | 0

Answered
A nd B are defined, but i can't get past this line: Csum = fuzarith(x,A,B,'sum'); WHy?
Hi @Michael Check if this is what you want. The Gaussian functions on your original legend were incorrect. The fuzarith() funct...

2 months ago | 0

Answered
3x-y+4=0 how to solve this equation in matlab
Hi @Adam The given equation can be rewritten in this familiar line equation form You can substitute any real value into ...

2 months ago | 0

Answered
Why a manually made PID controller in Simulink will show a different value when compared to the default PID controller Simulink black with both having the same Kp,Ki and Kd?
Hi @Ian It's because the PID block in Simulink implements a PID controller in this form: where a first-order transfer functi...

2 months ago | 0

| accepted

Answered
How to plot a polynomial?
Hi @Sarah Elena Aiko Johnson Should try like this: xi = linspace(-2, 8, 101); fend = - 2 + (6*xi) - 4*(xi.^2) + (0.5*(xi.^3))...

2 months ago | 0

| accepted

Answered
Piece-wise Functions
Let's try something very basic. t1 = -5:0.1:0; t2 = 0:0.1:10; t3 = 10:0.1:20; t4 = 20:0.1:30; t5 = 30:0.1:50; % Segment...

2 months ago | 0

Answered
How to solve ODE on array variables
Hi @Telema Harry Perhaps you can do this way: tspan = [0 0.1]; x0 = [2 1.5 1 0.5]; [t, x] = ode45(@odefcn, tspan, x0); ...

2 months ago | 0

| accepted

Load more