Answered
plotting, no graph appears
@Patrick Monst Because you forgot the 'dot' when dividing corresponding elements in the x vector. x = 0:0.01:1; y = (0.5*(1-x...

4 years ago | 0

Answered
given the aeeay of angles an = pi/n,n=2,3,...,9.generete a script that computes cos an and display the results as
@Mrunal Shah If you don't want to use the For loop approach, then try this: n = 2:1:9 A = [n; cos(pi./n)]; fprintf('%s %10s\...

4 years ago | 0

Answered
How do i get a direction field plot?
Hi @Tuân Nguyen Because there are two equilibrium points and , I think it should look like this. [T, P] = meshgrid(0:6e3/14:6...

4 years ago | 2

| accepted

Answered
How to design PI controllers within Maltab?
Hi @Kyle Ramphal If the result from the PID Tuner app can be admitted as the design solution, then just do so to directly obtai...

4 years ago | 1

| accepted

Answered
How to solve and graph a second order nonlinear differential equation?
Hi @Parcher Not exactly sure what you are tring to solve, but this worth a try, although it may not be the exact solution that ...

4 years ago | 0

Answered
How to solve an equation with two variables?
@Enver Kocaman The surface has singularities because there are conditions that cause , (division-by-zero). The surface shows a...

4 years ago | 0

Answered
How to add my IQ samples in Simulink as input data?
Hi @raya alhajri You can load data from MAT file into Simulink model using the "From File" Block directly: https://www.mathwor...

4 years ago | 0

Answered
how to collect similar equation and find all of them
@wlat hamad Have you checked if the collect() function works for your case? https://www.mathworks.com/help/symbolic/sym.collec...

4 years ago | 1

| accepted

Answered
Print value of correlation to a plot displaying two functions
@Loriann Chevalier Perhaps like this? v = corr(y1,y2,'Type','Kendall'); txt = ['Corr = ', num2str(v)]; text(4, 0.5, txt)

4 years ago | 0

Answered
How to do an elimination procedure to represent the solution (matrix)
Can you show the slides and elimination formulas? Otherwise, I think this elimination procedure: A = [1 -2 1; 0 2 -8; ...

4 years ago | 2

| accepted

Answered
How to plot two vectors at the same time
@Jonas Morgner, Do you mean llke this? v1 = [1 -2 -5 6]; v2 = -100 : .1 : 100; y = polyval(v1, v2); plot(v2, y)

4 years ago | 2

| accepted

Answered
In the fraction formed by the symbolic variable "s", the coefficient is too large and shows as “Inf”, which cannot separate the numerator and denominator. How to simplify it?
@梦雪 王, Have you tried this? sympref('FloatingPointOutput', true) It should display the expression in floating-point format.

4 years ago | 1

Answered
Using ‘surf’ plot the surface f (x, y) =x(x^2+y^2).
I guess it's here: z=x.*(x.^2 + y.^2);

4 years ago | 1

Answered
Evaluate the expression 𝑦 = 4𝑥3 + 6𝑥2 + 𝑥 + 1 using MATLAB for 𝑥 = 2.
@Muhammad Kashif This is very strictly based how you displayed the equation. x = 2; y = 4*x*3 + 6*x*2 + x + 1 Mostly likel...

4 years ago | 0

Answered
Evaluate (3-4i)(-4+3i) in MATLAB.
@Muhammad Kashif You will need a Alphanumeric Keyboard lets the user type in Latin alphabet, numeric characters, and mathemati...

4 years ago | 1

Answered
Problem with designing MPC
Hi @Marcin Pilzak Because you need to have the MPC object in the Workspace. And this is how you create a basic one: Plant = tf...

4 years ago | 0

Answered
How to find steady state solution of recatti equation
@shahin sharafi You can find the solution for x with the Implicit algebraic Riccati equation solver: [X, K, L] = icare(A_Star,...

4 years ago | 0

Answered
how to save variables in a for loop
@ADNAN KIRAL for x =1:5 y(x) = x*x; end disp(y)

4 years ago | 1

| accepted

Answered
How to calculate rise time, settling time, and overshoot based on real data measurements
Hi @Konvictus177 The rise time, settling time, and percentage overshoot can directly obtained from measured step response data....

4 years ago | 1

| accepted

Answered
Solving a non linear ODE with unknown parameter
Hi @khaoula Oueslati This governing equations are given and you have acquired the data. The objective is want to find . ...

4 years ago | 0

Answered
What is this symbol?
@hyun woo ryu It's a Selector. https://www.mathworks.com/help/simulink/slref/selector.html

4 years ago | 1

| accepted

Answered
Solve equation by fzeros
@Hoang Vu Huy The fzero requires initial guess. Pick the initial value that is closest to the root: fzero(@(x) x - 4*sin(x), p...

4 years ago | 1

Answered
How do I print the solution equation from an ode solver
@Alex Monserrat Use the text() function: tspan = [0 5]; y0 = 0; [t, y] = ode45(@(t,y) 2*t, tspan, y0); % disp([t, y]); plo...

4 years ago | 1

| accepted

Answered
How to get area under the fit attained by Curve Fitting tool?
Hi @Anik Mukhopadhyay You can check if this works: t = linspace(0, 270, 10); T = [30 32 34.5 38.6 40 42 42.5 42.5 42 41.5]; ...

4 years ago | 0

Answered
Finding the value of the below curve
Hi @Amy Topaz Since the curves are arctangent functions, the max values can be found at the boundary, in this case, that is a11...

4 years ago | 0

Answered
how to solve Energy balance equation
@kashif kamal You can use this sample and assign known values to the parameters in the Energy balance equation. % Constants V...

4 years ago | 1

| accepted

Answered
does anyone has the Matlab code for photovoltaic maximum power point tracking using simulated annealing algorithm?
Hi @Shema If you are looking for the Maximum Power Point Tracking model, then you can find many sample MPPT models in FileExcha...

4 years ago | 1

| accepted

Answered
Rearrange an equation to solve for a different variable
@Brian Kirkland If the explicit solution cannot be found, then it is probably a transcendental equation, just like this one: ....

4 years ago | 0

Answered
Hi, I have a problem understanding the use of odetovectorfield for converting syms variables into a vector for ODE45 input.
Hi @liouville In order to use odeToVectorField() effectively, the highest-order derivatives must appear linearly, and in your s...

4 years ago | 1

| accepted

Answered
Getting a solution for two coupled nonlinear differential equations
@sardar peysin Please check if this works out for your study: A = 1.0; B = 1.0; fun = @(t, x)[-A*x(1)*x(2)^4; % 1st OD...

4 years ago | 4

| accepted

Load more