Réponse apportée
How to plot a summation vs the x
When you do sum(y), it sums each element and gives you a scalar value. I think what you want is; H = cumsum(y);

presque 8 ans il y a | 1

| A accepté

Réponse apportée
Plot root loci with ((K))
You get your transfer function in the form; sys = k*G(s) then to get root locus you call the function rlocus(G)

presque 8 ans il y a | 0

Réponse apportée
Second time derivative of function?
It does not work, because the length of diff(x) and diff(t) are not the same. diff function takes the difference between each el...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How to limit data from a fit?
Create new variables; range = find(x<150); xNew = x(range) yNew = y(range) Obtain your fit using xNew and yN...

presque 8 ans il y a | 0

Réponse apportée
How do I use loops to model a function of displacement changing with respect to angle over time?
You have a few typos in your implementation and you do not need a for loop either. Here is the code; h = 60; b = 130; ...

presque 8 ans il y a | 1

| A accepté

Réponse apportée
matlab code to plot and calculate the displacemenet of links in four bar linkage
A simple google search would have given you this <https://www.mathworks.com/matlabcentral/fileexchange/32294-four-bar-linkage-al...

presque 8 ans il y a | 0

Réponse apportée
Sine wave plot for different frequency
Here is the code; f = 1:20 Fs = 200; % Sampling frequency t = 0:1/Fs:1; % Time vector of 1 second amp = 1; x = ...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How to Subtract Consecutive Values in Array in Simulink
You can use a time delay block and use fixed step solver. Set the time delay to be exactly the time step used by the solver. You...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
Is it possible the Simulink solver make the stable system unstable?
It can. For instance when you choose variable step, different solvers might use different step sizes and for large step sizes th...

presque 8 ans il y a | 0

Réponse apportée
How to store vector name and value in the result
Here is an example code; xName = ['x1';'x2';'x3';'x4']; xVal = [1;2;3;4]; A = table(xName,xVal); Result look like ...

presque 8 ans il y a | 0

Réponse apportée
How to solve a linear system with component varying?
Here is one way to do it; index = 0; S = -2:0.01:2; for i = 1:length(S) index = index+1; s_...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
Hello, I had a problem over here in MATLAB code for solving a linear first ode using RK method of order 5 :dx/dt= lambda-sigma*x(t)- c*v(t),dv/dt=k*v(t)-a*z(t),dz/dt=h*x(t)-tow*v(t) with initial conditions x(0)= x0,v(0)=v0,z(0)=x0.
It is a simple think and there are various code out there. <https://www.mathworks.com/matlabcentral/fileexchange/29851-runge-kut...

presque 8 ans il y a | 0

Réponse apportée
Plot with respect to time, not samples
You define the time variable yourself. You know that you sample at 9 kHz so you know that between each sample there is 1/8000 se...

presque 8 ans il y a | 2

| A accepté

Réponse apportée
Four-dimensional contourf plot in Matlab
I do not think there is a way like you imagine but take a look at <https://www.mathworks.com/help/matlab/visualize/overview-of-v...

presque 8 ans il y a | 0

Réponse apportée
Iterate over vector from result of a for loop
Since the results will be a matrix, you should use 2 index; capacity=[270 -130 470 170 120 20 -30 220 370 4...

presque 8 ans il y a | 1

Réponse apportée
Why am I getting Undefined function or variable 'kp' despite having defined it in the code?
Becuase you define "kp" variable a little late. From your polyadiabatic function; % Kinetics Rp = (kp).*rho.*A(1).*((2...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How can I display elements of a 2D matrix as blue, green and red squares?
A simple fix would be to add 3 additional variables to your matrices that have X and Y values that are outside of your region of...

presque 8 ans il y a | 0

Réponse apportée
MatLab doesn't read my .TXT file correct
Your data has comma (,) in them. I do not think Matlab can read values with commas, i.e., 2,230. You should change those commas ...

presque 8 ans il y a | 1

Réponse apportée
How to fix this code
In these lines; xc=sum((x+xp).*a)/6/A yc=sum((y+yp).*a)/6/A when A is 0, these values become NaN since division by 0 is...

presque 8 ans il y a | 0

Réponse apportée
Count how many times a number is repeated in a certain row of an array
Here is a code; A = [1;1;1;2;2;2;2;2;3;3;4;4;4;4;4;4;4;5;5;5;5]; c = unique(A); % the unique values in the A (1,2,3,4,5) ...

presque 8 ans il y a | 1

| A accepté

Réponse apportée
I have to shade the area between the two curves, i have used fill function including fliplr, but no success?
Here is how I did it; t= 0:0.1:10; y1 = sin(t); y2 = sin(5*t)-6; fill([t t(end:-1:1)],[y1 y2(end:-1:1) ]','r') <</m...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How to solve the following system of ODE's?
Here is a code; syms Po(t) Pi(t) co = 5; cl = 2; pes = 2; pon = 10; peu = 7; R = 34; cs = 23; cb = 10; Q...

presque 8 ans il y a | 0

Réponse apportée
Find number of terms in taylor expansion upto when error is 10^(-6)
There is an approximation for upper bound on the error (or remaining terms in Taylor expansion). Here is a <https://math.dartmou...

presque 8 ans il y a | 0

Réponse apportée
Modifying the Tolerance (TolX) inside the Matlab function file (fzero.m).
Feed "optnew" to the fzero function, not "options". You are not changing the setting of options with that command.

presque 8 ans il y a | 1

Réponse apportée
How I can identify that two different images are of a same person?
A brief google search reveals; # <http://www.scholarpedia.org/article/Eigenfaces Eigenfaces> # <http://www.scholarpedia.org/...

presque 8 ans il y a | 0

Réponse apportée
I want to determine the magnitude and phase of 100kHz Sinusoidal in a given signal when the sampling rate is 15MHz and when the signal has 32768 samples.
When you do an FFT, you basically assign magnitudes to each frequency. The frequency points are usually called bins and are dete...

presque 8 ans il y a | 2

| A accepté

Réponse apportée
Hi , how can i plot of the sum of ode solutions using the sum function?
You should use; plot(tv,sum(c(:,1:4)'),'m-') sum command sums each column, however, what you want is the sum of the rows...

presque 8 ans il y a | 0

Réponse apportée
classifying matrix value based on its element
Is this what you are trying to achieve; a = [201 5 5 306 20 5 ...

presque 8 ans il y a | 0

Réponse apportée
INDEX EXCEEDS ARRAY BOUNDS
In your code you have slight mistake, where you forgot to assign to an index but instead overwrite the variable ("(i)" is the fi...

presque 8 ans il y a | 0

Réponse apportée
Draw a line from 2 points and get x and y values
Simple linear interpolation code; % 100 points on the line connecting [x1 y1] and [x2 y2] x = linspace(x1,x2,100); % 100...

presque 8 ans il y a | 0

| A accepté

Charger plus