Answered

Steady state doesn't appear in step response plot

The bad_sys works if you call the step function with; step(minreal(bad_sys/(1+bad_sys))) I am not sure about the exact r...

Steady state doesn't appear in step response plot

The bad_sys works if you call the step function with; step(minreal(bad_sys/(1+bad_sys))) I am not sure about the exact r...

12 Monate ago | 0

| accepted

Answered

Saving output of for loop in array

There are some mistakes and unclear parts in your code. However, using your code, you can save it as; Pload = linspace (1,2...

Saving output of for loop in array

There are some mistakes and unclear parts in your code. However, using your code, you can save it as; Pload = linspace (1,2...

etwa ein Jahr ago | 0

Answered

Find the frequency at maximum value in pwelch function

You can obtain the frequency and power vectors from pwelch function. Example; fs = 1e3; t = 0:1/fs:1-1/fs; x = sin(2*...

Find the frequency at maximum value in pwelch function

You can obtain the frequency and power vectors from pwelch function. Example; fs = 1e3; t = 0:1/fs:1-1/fs; x = sin(2*...

etwa ein Jahr ago | 0

Answered

plot for x^2+y^2==3*x*y^2, x^3-x^2==y^2-y in matlab

syms x y real eq1 = x^2+y^2==3*x*y^2; eq2 = x^3-x^2==y^2-y; figure(1) ezplot(eq1) figure(2) ezplot(eq2) ...

plot for x^2+y^2==3*x*y^2, x^3-x^2==y^2-y in matlab

syms x y real eq1 = x^2+y^2==3*x*y^2; eq2 = x^3-x^2==y^2-y; figure(1) ezplot(eq1) figure(2) ezplot(eq2) ...

etwa ein Jahr ago | 0

Answered

Plotting FFT of several data sets (signals) of same length, in the same graph

y = [] just makes y an empty matrix. It is not a necessary code. I include it in the off chance that you had a variable named y ...

Plotting FFT of several data sets (signals) of same length, in the same graph

y = [] just makes y an empty matrix. It is not a necessary code. I include it in the off chance that you had a variable named y ...

etwa ein Jahr ago | 0

Answered

Listing possible combinations of integers, given constraints (Gear Ratio Related)

One possibility is using an optimization. Here is a simple code for it using OPTI toolbox; clear all,clc % round() is...

Listing possible combinations of integers, given constraints (Gear Ratio Related)

One possibility is using an optimization. Here is a simple code for it using OPTI toolbox; clear all,clc % round() is...

etwa ein Jahr ago | 0

Answered

Count two columns with corresponding data

One thing you can do is (assuming you have newer versions of matlab); A = rand(10,2); % the data a1 = A(A(:,1)<0.3,:); ...

Count two columns with corresponding data

One thing you can do is (assuming you have newer versions of matlab); A = rand(10,2); % the data a1 = A(A(:,1)<0.3,:); ...

etwa ein Jahr ago | 0

Answered

Damping Factor and natural frequency out of time response data

If this is impulse response, you can get the natural frequency by simply finding the time difference between each peak. Invertin...

Damping Factor and natural frequency out of time response data

If this is impulse response, you can get the natural frequency by simply finding the time difference between each peak. Invertin...

etwa ein Jahr ago | 0

Answered

Interpolate between two signals in Simulink

Here is how linear interpolation works; y1 = 10; % known flow rate for 47500 ft y0 = 2; % known flow rate for 23000 ft...

Interpolate between two signals in Simulink

Here is how linear interpolation works; y1 = 10; % known flow rate for 47500 ft y0 = 2; % known flow rate for 23000 ft...

etwa ein Jahr ago | 0

Answered

Plotting FFT of several data sets (signals) of same length, in the same graph

You put all of the signals you want in a matrix (each column is a different partition of the signal); data = rand(60000,1)...

Plotting FFT of several data sets (signals) of same length, in the same graph

You put all of the signals you want in a matrix (each column is a different partition of the signal); data = rand(60000,1)...

etwa ein Jahr ago | 0

| accepted

Answered

ODE45 not updating a variable of nonlinear 2nd order diff.eq system

The reason is simple. Your dxdt(3) is always equal to 0. You do not have an equation for dxdt(3) in your function other than the...

ODE45 not updating a variable of nonlinear 2nd order diff.eq system

The reason is simple. Your dxdt(3) is always equal to 0. You do not have an equation for dxdt(3) in your function other than the...

etwa ein Jahr ago | 1

| accepted

Answered

How can i measure Angle in 3-D?

Check out this <http://portal.tpu.ru:7777/SHARED/k/KONVAL/Sites/English_sites/G/l_Angle_f.htm link> which has the answer.

How can i measure Angle in 3-D?

Check out this <http://portal.tpu.ru:7777/SHARED/k/KONVAL/Sites/English_sites/G/l_Angle_f.htm link> which has the answer.

etwa ein Jahr ago | 0

Answered

Eulers Method Returning an Answer close but not exactly correct

The reason is simple. The time in your code start from 1 where as online calculators start from 0. If you adjusted your equat...

Eulers Method Returning an Answer close but not exactly correct

The reason is simple. The time in your code start from 1 where as online calculators start from 0. If you adjusted your equat...

etwa ein Jahr ago | 0

Answered

How to conditionally solve two ODEs simultaneously using 'if-else' ?

ode45 does not check its values between start and end time. That is why you need to write your own solver or include the ifelse ...

How to conditionally solve two ODEs simultaneously using 'if-else' ?

ode45 does not check its values between start and end time. That is why you need to write your own solver or include the ifelse ...

etwa ein Jahr ago | 1

| accepted

Answered

How to solve the following System of first order differential equations using ode45?please help

First you create your function that outputs derivative of q when time and q are given to it. function qd = asd(t,q) k1...

How to solve the following System of first order differential equations using ode45?please help

First you create your function that outputs derivative of q when time and q are given to it. function qd = asd(t,q) k1...

etwa ein Jahr ago | 1

Answered

Can I issue a command to see when my license expires?

<https://www.mathworks.com/matlabcentral/answers/302548-how-can-i-check-the-expiration-date-of-my-matlab-license Check this answ...

Can I issue a command to see when my license expires?

<https://www.mathworks.com/matlabcentral/answers/302548-how-can-i-check-the-expiration-date-of-my-matlab-license Check this answ...

etwa ein Jahr ago | 0

Answered

mod(a,b) floating-point rounding error

x(3,121) is not exactly 0.2. It is slightly less than 0.2. That is why when Matlabs mod() function does its algorithm, which is;...

mod(a,b) floating-point rounding error

x(3,121) is not exactly 0.2. It is slightly less than 0.2. That is why when Matlabs mod() function does its algorithm, which is;...

etwa ein Jahr ago | 0

Answered

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 11-by-11.

Here is the problem; DpiE(i,j)=DPiIX/DtX Both DPiTX and DTX are 11x1 vectors. When you divide 11x1 with 11x1 Matlab thin...

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 11-by-11.

Here is the problem; DpiE(i,j)=DPiIX/DtX Both DPiTX and DTX are 11x1 vectors. When you divide 11x1 with 11x1 Matlab thin...

etwa ein Jahr ago | 0

Answered

MATLAB Being Helpful hah:

What is the question? I assume the question is why the answers are different. Answer is simple 10e-12 is not equal 10^-1...

MATLAB Being Helpful hah:

What is the question? I assume the question is why the answers are different. Answer is simple 10e-12 is not equal 10^-1...

etwa ein Jahr ago | 1

| accepted

Answered

How to extract the exponential term?

Here is one way; floor(log10(1.2346e+02))

How to extract the exponential term?

Here is one way; floor(log10(1.2346e+02))

etwa ein Jahr ago | 0

| accepted

Answered

I want to make a programming function in which I want to take input any mathematical function like f(x)=sin(x)+x^2. then I take a input x and my function return a value of f(x).but i don't know how can i do?

Here is a simple Matlab script; f_math = @(x) sin(x)+x.^2;% mathematical function, notice the element wise operation fun...

I want to make a programming function in which I want to take input any mathematical function like f(x)=sin(x)+x^2. then I take a input x and my function return a value of f(x).but i don't know how can i do?

Here is a simple Matlab script; f_math = @(x) sin(x)+x.^2;% mathematical function, notice the element wise operation fun...

etwa ein Jahr ago | 0

Answered

How to force zero or positive entries in matrix when solving LMI?

You can simply add another constraint to the LMI to impose the constraint. For instance, assume decision variables are x and ...

How to force zero or positive entries in matrix when solving LMI?

You can simply add another constraint to the LMI to impose the constraint. For instance, assume decision variables are x and ...

etwa ein Jahr ago | 0

| accepted

Answered

How to create for loop for the below case

First of all, your code does not look like it is in order. You define C after you calculate Q? You do not use X in any calculati...

How to create for loop for the below case

First of all, your code does not look like it is in order. You define C after you calculate Q? You do not use X in any calculati...

etwa ein Jahr ago | 0

Answered

How to feed timeseries data to parameter

One way is to define the parameter as a signal (if the parameter is in the gain inside a gain block, change the gain block to pr...

How to feed timeseries data to parameter

One way is to define the parameter as a signal (if the parameter is in the gain inside a gain block, change the gain block to pr...

etwa ein Jahr ago | 0

Answered

returning values of a matrix between two values

desiredData = data(:,event_samples(1):event_samples(end))

returning values of a matrix between two values

desiredData = data(:,event_samples(1):event_samples(end))

etwa ein Jahr ago | 0

Answered

Closed-loop system identification

Assuming you can add excitation signal to u, and with large enough excitation signal magnitude, you can identify G1 without know...

Closed-loop system identification

Assuming you can add excitation signal to u, and with large enough excitation signal magnitude, you can identify G1 without know...

etwa ein Jahr ago | 0

| accepted

Answered

How to make semilogx to get a plot gain against log frequency with several values?

Is this what you want; freq = [2 10 20 60 100 125 150 200 300 400]; Vo = [0.15e-7 .1e-3 .002 .2 1.5 3.28 4.47 4.97 4....

How to make semilogx to get a plot gain against log frequency with several values?

Is this what you want; freq = [2 10 20 60 100 125 150 200 300 400]; Vo = [0.15e-7 .1e-3 .002 .2 1.5 3.28 4.47 4.97 4....

etwa ein Jahr ago | 0

| accepted

Answered

solving rlc circuit using ode45

If you were to use the code; [t,y] = ode45(@homework,t,[0 0 0]'); the y here is your i1, i2, and vc. From here yo...

solving rlc circuit using ode45

If you were to use the code; [t,y] = ode45(@homework,t,[0 0 0]'); the y here is your i1, i2, and vc. From here yo...

etwa ein Jahr ago | 0

| accepted

Answered

How to plot a numerical integration?

The problem is, the quadgk function expect a scalar value from your function. However you assign z to be a vector, hence your fu...

How to plot a numerical integration?

The problem is, the quadgk function expect a scalar value from your function. However you assign z to be a vector, hence your fu...

etwa ein Jahr ago | 1

| accepted

Answered

Why FOR LOOP doesn't work for the descrete state space?

The reason is continous time and discrete time A and B matrices are different. In the code you are not using the right A and B m...

Why FOR LOOP doesn't work for the descrete state space?

The reason is continous time and discrete time A and B matrices are different. In the code you are not using the right A and B m...

etwa ein Jahr ago | 0

| accepted