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

6 years 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;...

6 years 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...

6 years 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...

6 years ago | 1

| accepted

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

6 years ago | 1

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

6 years 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 ...

6 years 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...

6 years 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...

6 years ago | 0

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

6 years 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...

6 years 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....

6 years 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...

6 years 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...

6 years 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...

6 years ago | 0

| accepted

Answered
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, ...

6 years ago | 0

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

6 years ago | 0

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

6 years ago | 1

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

6 years ago | 1

| accepted

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

6 years ago | 0

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

6 years ago | 1

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

6 years ago | 0

| accepted

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

6 years ago | 0

| accepted

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

6 years ago | 0

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

6 years ago | 1

| accepted

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

6 years ago | 0

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

6 years ago | 0

| accepted

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

6 years ago | 0

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

6 years ago | 0

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

6 years ago | 0

Load more