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

más de 5 años hace | 0

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

más de 5 años hace | 0

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

más de 5 años hace | 0

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

más de 5 años hace | 1

| aceptada

Respondida
How to extract the exponential term?
Here is one way; floor(log10(1.2346e+02))

más de 5 años hace | 1

| aceptada

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

más de 5 años hace | 0

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

más de 5 años hace | 0

| aceptada

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

más de 5 años hace | 0

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

más de 5 años hace | 0

Respondida
returning values of a matrix between two values
desiredData = data(:,event_samples(1):event_samples(end))

más de 5 años hace | 0

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

más de 5 años hace | 0

| aceptada

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

más de 5 años hace | 0

| aceptada

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

más de 5 años hace | 0

| aceptada

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

más de 5 años hace | 1

| aceptada

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

más de 5 años hace | 0

| aceptada

Respondida
Matlab continues to run and wont stop. Is my solution to complicated?
Try doing this in your code; fx = simplify(expand(diff(f,x))); fy = simplify(expand(diff(f,x))); I think in your code, ...

más de 5 años hace | 0

Respondida
How to use LQR for finding the control gain matrix K in presence of constraints?
That is what Q and R matrices are for. Increasing the values in the R matrix will result in a decrease in control input however ...

más de 5 años hace | 0

Respondida
How to write the matlab codes for the following transfer function
Assuming G(z) is a SISO(single input-single output) system, here is the code; z = tf('z'); G = z/(z+1); T = minreal(5...

más de 5 años hace | 1

Respondida
How to separate M*3 matrix by interval of 1
One simple way is; A = rand(20,3)*10; for i = 0:9 At{i+1} = A(A(:,1)>i&A(:,1)<i+1,:,:); % Rows of A matrix where f...

más de 5 años hace | 1

| aceptada

Respondida
4-point first derivative
I found a <http://oregonstate.edu/instruct/ch490/lessons/lesson11.htm source> where the equations for the differentiation are sh...

más de 5 años hace | 0

Respondida
optimally selecting elements in matrix to satisfy the system of equations
First of all, in Matlab you need to use expm() function for matrix exponentials. Secondly, your 1st equation is wrong. the ri...

más de 5 años hace | 1

Respondida
Index exceeds matrix dimensions is the error I'm getting.
The reason is simple; since year and Tair_monthly variable do not have sam number of elements, the ind variable tries to access ...

más de 5 años hace | 0

| aceptada

Respondida
Using "solve" on symbolic equation returns complex numbers when it shouldn't.
Because there is an imaginary root to that equation as well. If you were to evaluate your sfun using T2s you will see the result...

más de 5 años hace | 0

| aceptada

Respondida
Method to manipulate data
You can use "Switch" blocks change your signal from whatever it is to a constant 0 using the time as a determining factor. Al...

más de 5 años hace | 0

Respondida
Sorting and rearranging data in multiple columns
One thing is you cannot store 3 columns in first row and 2 columns in others. Here is a working example of what you want to d...

más de 5 años hace | 1

| aceptada

Respondida
Assigning a function that does not exist to a new function?
In Matlab functions are defined as function y = funName(x) which takes the input x and outputs y. So in the pasted code...

más de 5 años hace | 0

Respondida
I have a state space system like this and I want to Augment the discrete-time plant model with an integrator, and check controllability and observability of the augmented model.
Integral in discrete time using Forward Euler method; x(k+1) = x(k) + dt*u; y(k) = x(k); Other methods can be found...

más de 5 años hace | 0

| aceptada

Respondida
Reducing state space order by doing matrix operations
Removing 2nd plant input; B(:,2) = []; Removing the outputs 1,2,3,4,6,7,8; C([1 2 3 4 6 7 8],:) = [];. Adjusting...

más de 5 años hace | 0

Respondida
combining matlab code to simulink
You are looking for " <https://www.mathworks.com/help/simulink/ug/creating-an-example-model-that-uses-a-matlab-function-block.ht...

más de 5 años hace | 0

Respondida
Euler Method IVP Coding Help
Your x vector only has a single element in it. After while loop goes once, it tries to reach x(2), which does not exist. That is...

más de 5 años hace | 0

Cargar más