Respondida
finding if number(iteration) is the sum of 2 numbers inside same array - matlab
Hi @Oren Savir This is just a very simple example. You can turn it into a loop to check each element in the array. % The array...

más de 4 años hace | 0

Respondida
Multiplying f(x) with f(-x)
Hi @Omar Decevic You can try this and take over from here: x = -16:0.01:16; f = @(x) x.^3 + 15*x.^2 + 7*x + 2; plot(x, f(x)....

más de 4 años hace | 0

Respondida
Add an optimization algorithm to simulink
Hi @Hend Mostafa Please follow the example here: https://www.mathworks.com/help/physmod/sps/ug/battery-parameter-extraction-fr...

más de 4 años hace | 1

| aceptada

Respondida
Temperature matrix giving NaN
@Mohammad Hassan The T matrix gives NaN because the temperature T is an array of zeros to begin with T = zeros(nx, nt); and...

más de 4 años hace | 1

| aceptada

Respondida
delete or remove some value from vector
Hi @Takim Mustakim Perhaps you can try this to see if it is deleted. wk(end) = []

más de 4 años hace | 1

| aceptada

Respondida
Im solving for the EOM of a 3 DOF vibrations problem with ode 45 and am having trouble getting the indices to agree when I try to store the equations in my ydot term.
Hi @CARSON KATZ Should be working now. However, it is observed that your stiffness matrix is a Tridiagonal matrix, while your ...

más de 4 años hace | 1

| aceptada

Respondida
Tuning PID using GA for multiple plants
Hi @SM For multiobjective optimization, then you should consider using this gamultiobj() command. https://www.mathworks.com/he...

más de 4 años hace | 1

| aceptada

Respondida
How to convert SDOF system to MDOF system of Nonlinear Dynamic analysis of a building
@Chaudhary P Patel I'm not a certified Building Dynamicist. But if the equations of motion of a 4-storey building can described...

más de 4 años hace | 0

Respondida
Output a plot and a matrix from a function
Hi @Miranda Gabriel Remove the semicolon ";" in this line should produce mymatrix on the Command Window. mymatrix = [locs(:), ...

más de 4 años hace | 0

Respondida
I want to plot an implicit equation
Hi @mohd ayaz I tried to plot this way to first visualize how the curve looks like for the positive part of . Qm = linspace(-1...

más de 4 años hace | 1

Respondida
How to deal with the time response of first order system?
@Cola, let's correct your Simulink model first. The ODE is given by which can be rearranged into Integrating both sides a...

más de 4 años hace | 2

| aceptada

Respondida
Plotting streamlines in an unsteady flow given vector field equation
@Kiat Tsen Lim Since it involves the time dimension, I think you will need to use the quiver3() function. https://www.mathwork...

más de 4 años hace | 1

| aceptada

Respondida
How can I create a function with several summations and Kronecker delta symbol in two dimension?
@matlab beginner Have you tried this kroneckerDelta() function? https://www.mathworks.com/help/symbolic/sym.kroneckerdelta.htm...

más de 4 años hace | 1

Respondida
Sigma-delta ADC under simscape
@Peter Balazovic Found an example model here. Do you think you can remodel it with the Simscape blocks? https://www.mathworks....

más de 4 años hace | 0

Respondida
Create a long rectangular signal with a function handle
@AEW Second opinion! fcn = @(t) (sign(sin(2*pi*t)) + 1)/2; ezplot(fcn, 0, 5)

más de 4 años hace | 1

Respondida
ode return NaN :(
Hi @ZH CC The odeToVectorField(eqn) returns this V = ...

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 2

| aceptada

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

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 0

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

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

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

más de 4 años hace | 2

| aceptada

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

más de 4 años hace | 2

| aceptada

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

más de 4 años hace | 1

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

más de 4 años hace | 1

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

más de 4 años hace | 0

Cargar más