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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

Mehr laden