Answered
can you please explain the working of following syntax?
The code you posted does not make sense. It sets *|‘extrema’|* to an empty array, so all references to elements of *|‘extrema’|...

9 years ago | 0

Answered
how can i implement integralN (given by Sir Mike Hosea)
This takes forever and may not converge (I did not let it complete), but at least appears to run: f = @(x,y,z,w) 1./((x.^x...

9 years ago | 0

Answered
index exceeds matrix dimensions
The *|fplot|* function is expecting a function and a range for the independent variable. Try this: fplot(@(k) ((50*2....

9 years ago | 0

Answered
Difficulty solving and plotting solution to complicated second order ODE.
The time (or other independent variable) has to come first in the argument list of ODE functions. Reverse them and it works...

9 years ago | 0

| accepted

Answered
matlb solution dX/dt=AX(t)+B
We need to see your code to determine what the problem is. The ODE solvers such as *|ode45|*, and for ‘stiff’ systems *|ode15s|...

9 years ago | 0

| accepted

Answered
Text Not Showing On Plot
The <https://www.mathworks.com/help/matlab/ref/text.html *|text|*> (link) function has a number of <https://www.mathworks.com/he...

9 years ago | 1

| accepted

Answered
How to create a state space model from a custom transfer function?
*_‘I do not have input or output values.’_* You do, actually. With a specific input, your output is described as: * in...

9 years ago | 0

Answered
Why am I getting complex values in a function after IFFT function?
*_‘I am missing some concept here.’_* No. You simply made a typographical error in your code. You are getting complex val...

9 years ago | 0

| accepted

Answered
Probability calculation returns NaN instead of number
You need to use the Symbolic Math Toolbox or some other extended-precision option: v1 = sym(171); v2 = sym(86); Q = ...

9 years ago | 1

| accepted

Answered
Error when computing integral
This runs without error: syms Xs i L phi_i(Xs,i,L) = Xs^(i-1)*(1-cos(Xs*pi / (2*L))); d2_phi(Xs,i,L) = diff(phi_i,Xs...

9 years ago | 0

Answered
Why is fsurf complaining when it plots -e^(-x^2)?
The warnings disappear if you use element-wise operations (the ‘dot operator’ for the exponentiation), and the plot looks better...

9 years ago | 0

Answered
How to make the maximum value in a 3D map more prominent
You will have to plot the *|‘(X,Y,Z)’|* matrices of your surface, not simply the *|‘Z’|* matrix. With that condition, this ...

9 years ago | 0

| accepted

Answered
How to use an if function to determine the value of one matrix using the values of another matrix?
Use ‘logical indexing’: C = [3,5,6]; T = [0.3,0.6,0.9]; C(T >= 8/24) = 0 C = 3 0 0

9 years ago | 0

| accepted

Answered
What is meant by this syntax : L(1) , what does these braces after any variable mean?
The parentheses and the numbers refer to the first *|2|* elements in vector *|‘L’|*. See <https://www.mathworks.com/help/ma...

9 years ago | 0

| accepted

Answered
command to actually play the vidoe frame by frame
If you do not have the Image Processing Toolbox, see the documentation on <https://www.mathworks.com/help/matlab/import_export/r...

9 years ago | 0

Answered
Find highest third of values in dateset?
One approach is to use the *|sort|* function: WaveHeight=[3 1 5 2 3.1 6 5.5 3 2.5]; [Waves,Idx] = sort(WaveHeight, 'des...

9 years ago | 1

| accepted

Answered
How to compare a struct with time to a step response?
See the documentation on <https://www.mathworks.com/help/control/ref/stepplot.html *|stepplot|*> (link), and specifically <https...

9 years ago | 0

Answered
wrong etime output in seconds
It is difficult for me to understand what you are doing, even when I edited your post to correctly show the code. This work...

9 years ago | 0

Answered
How can I modify the code below to build a hexagon knowing the coordinates of the hexagon roofs?
Try this: function xy = polygon(sides) radians=(2*pi)./sides; r=ones(1,sides+1); theta=0:radians:2*pi; xy = [r...

9 years ago | 0

| accepted

Answered
Change the y-axis to the ratio value
Try this: x = 1:10; % Create Data y = linspace(40.2, 53.2, 10); figure(1) plot(...

9 years ago | 0

Answered
manipulate matrix dimension (ignoring lines)
Use the <https://www.mathworks.com/help/matlab/ref/textscan.html *|textscan|*> (link) function. Define: *|'HeaderLines',2|*...

9 years ago | 0

| accepted

Answered
How can I match a value on a matlab plot?
Use the *|‘locs’|* value: [pks,locs] = findpeaks(Voltage, 'MinPeakDist',2000, 'NPeaks',1); peakTimes = Time(locs); S...

9 years ago | 1

| accepted

Answered
I want to draw the following equation
See the documentation on the <https://www.mathworks.com/help/matlab/ref/trisurf.html *|trisurf|*> (link) function. It has all t...

9 years ago | 0

Answered
Variable importing into code
I would import *|‘y’|* as an array of some type (numeric, cell, table, etc.) and refer to the individual elements in your calcul...

9 years ago | 0

Answered
how to vectorize this code?
It appears that your code is segmenting your *|EKG|* record into *|477|*-element segments. The <https://www.mathworks.com/h...

9 years ago | 0

| accepted

Answered
why do i recieve "Attempt to execute SCRIPT entropy as a function:
*_‘Why I can't use "entropy(x)" command?’_* Because you saved it as a script. If you want to save it as a function, see...

9 years ago | 0

| accepted

Answered
how can i create a vertical array of a character e.g a vertical line with " | "
I am not certain what you want. Try this: for i = 1:2*n fprintf(' %s\n',verEdge) end

9 years ago | 0

Answered
Something is wrong in the Fourier transform...
When you zero-padded *|‘Hn’|*, you changed the frequency resolution of the Fourier transform. See if changing *|‘Fv’|* to: ...

9 years ago | 0

Answered
How can I determine the x-value of a sudden change in y-values?
It would help to have your data, and more detail about the features of your waveform you want to recover. The <https://www....

9 years ago | 2

| accepted

Answered
How to plot the best fit when x-axis has only one value?
Try this: x1 = [9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.384,9.38...

9 years ago | 0

| accepted

Load more