Answered
I made a function, but the outcome isn't right
You need to _vectorize_ your function (use element-wise multiplication and division, as well as exponentiation). This version w...

9 years ago | 0

Answered
I have a lot of data results, How do I find a parameter of an equation which can predict these results?
There are several articles on the Internet. One recent *|(2015)|* open-source discussion is <https://surface.syr.edu/etd/228/ *...

9 years ago | 1

| accepted

Answered
finding zero crossings in a signal
The code works correctly. The amplitude of your signal goes from *|-4|* to *|0|*, so the ‘zero-crossings’ in your signal are _c...

9 years ago | 2

Answered
How to find frequency shift in time-varying signal?
See if the <https://www.mathworks.com/help/signal/ref/spectrogram.html *|spectrogram|*> (link) function will do what you want. ...

9 years ago | 0

Answered
cobweb graph for 3 equations
I have no idea. Before your post, I never heard of a cobweb plot. If you want some example code for a cobweb plot, <http:/...

9 years ago | 1

Answered
error in displaying graph
In the first code example: for t=2:N P(t)=(d-q-(b*P(t-1)))/a; D(t)=d-a*P(t); Q(t)=q+b*P(t-1); end ...

9 years ago | 1

Answered
Normalise a Histogram excluding NaN?
One option is: histogram(m(~isnan(m)), 50, 'Normalization','PDF') This eliminates the *|NaN|* values from your data bef...

9 years ago | 2

| accepted

Answered
Why do I get different results for ode45 when I use different OUTPUT arguments?
The *|‘sol’|* structure is designed to be used with the *|deval|* function. Try this: sol = ode45(@(t,y) [-0.50*y(1)+...

9 years ago | 0

| accepted

Answered
Finding the 'loudest' frequency
Before you decide on a specific approach, if you have not already examined your data with the Signal Processing Toolbox <https:/...

9 years ago | 0

| accepted

Answered
Trying to use interpn - converting sample data into ndgrid format
Use the <https://www.mathworks.com/help/matlab/ref/ndgrid.html *|ndgrid|*> (link) function.

9 years ago | 0

Answered
Z domain to freq domain (bode of closed loop with negative feed back)?
If you have the Symbolic Math Toolbox, try this: syms z s Fs assume(Fs > 0) H(z) = (z + 1) / (z^2 + 10*z - 5); ...

9 years ago | 0

Answered
Can't see my text on a plot, but only for some values
When I used the Symbolic Math Toolbox to create *|‘odefun’|*, the problem became obvious. You are using the two *|‘Y’|* values ...

9 years ago | 0

| accepted

Answered
FIR filter for ECG signal
One problem is that your filter is not long enough. Try this: b=fir1(64,[0.119 0.121],'stop'); freqz(b,1) You m...

9 years ago | 2

Answered
Error in Matlab ode45
I suspect the errors in your code were obvious to Torsten. The problem is your *|‘amanda2’|* function. Functions have thei...

9 years ago | 0

Answered
Using fzero with syms or finding an alternative to syms
For this, use <http://www.mathworks.com/help/matlab/matlab_prog/anonymous-functions.html *Anonymous Functions*> (link). Using t...

9 years ago | 0

| accepted

Answered
Semilogy doesnt make my y axis logarithmic - R2017a
It is, actually. (I checked it by doing a linear plot of *|‘log(c)’|*.) The *|y|*-axis range is so small that it’s difficult t...

9 years ago | 0

Answered
how do i find the global maximum of a symbolic function?
I would use the first and second partial derivatives to find the inflection points, and whether each is a maximum, minimum, or s...

9 years ago | 0

Answered
cant mutplaye matrix by vector
If you are doing a state-space simulation, you are doing it incorrectly. You need to use a matrix exponential (the *|expm|* fun...

9 years ago | 0

Answered
Bound Fill Between Plot Lines
*_‘it connects one end of the plot back to the start’_* You must have a duplicated data value at the beginning or end of wh...

9 years ago | 0

| accepted

Answered
Getting Frequencies Corresponding to Peaks In FFT Plot
Use the <https://www.mathworks.com/help/signal/ref/findpeaks.html *|findpeaks|*> (link) function to determine the frequencies an...

9 years ago | 1

| accepted

Answered
Error "Not enough Input Arguments" in predator-prey model
You did not copy it correctly or implement it correctly. Try this: predPrey = @(t,x) [-x(1)+3*x(3);-x(2)+2*x(3);x(1)...

9 years ago | 0

| accepted

Answered
Why does length of signal matter in computing amplitude spectrum using fft?
A bit more information would be nice, so _guessing_ here. The effect you are seeing is most likely the effect of doing a _d...

9 years ago | 0

| accepted

Answered
When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time vector T, and as many columns as input channels problem
Since *|‘B’|* has two columns, *|‘u’|* must have two rows: This works: Ms = 267; Mu = 36.6; Ks = 18.742; Kt = 193....

9 years ago | 0

| accepted

Answered
Error using contour function
You need to use *|‘X’|* and *|‘Y’|* in *|‘Z’|*. Try this: x = linspace(-1, 1, 100); y = linspace(-1, 1, 100); [...

9 years ago | 2

| accepted

Answered
How to keep values whose corresponding index is present?
Try this: array1 = {1,1,1,0.92,0.61,0.47,0,0;1.6,1,1,1,0.6,0.5,0.4,0.8}; array2 = {[3,4,5,6];[4,5,7,8]}; Resulta...

9 years ago | 2

Answered
Undefined function 'bufferm' for input arguments of type 'double'.?
Since you were able to run it before, you must have the Mapping Toolbox installed. Run the *|ver|* command from your Command Wi...

9 years ago | 1

| accepted

Answered
My maintenance ran out at the end of September 2017. Can I upgrade to 2017B?
It is likely best to <https://www.mathworks.com/company/aboutus/contact_us/contact_sales.html?s_iid=htb_sales_gtwy_lhs *Contact ...

9 years ago | 0

Answered
Unknown line in code
This line: F=-Fs/2:Fs/Nfft:Fs/2-Fs/Nfft; defines the frequency vector for a two-sided *|fft|*, where *|0|* Hz is in the...

9 years ago | 1

| accepted

Answered
Please good people out there, i need help with how to vary a parameter in this code. In my case i want to vary TC from 180 to 220. How do i factor that into this code? Thank you very much for your help!!
I would add *|‘TC’|* as a parameter to your code, then increment it in a loop and pass it to your function: function [rate...

9 years ago | 1

Answered
Need help with writing equation
It appears to me to be correct. I would make one change, and that is to vectorise it (using the ‘dot operator’), in the eve...

9 years ago | 1

Load more