Answered
Trying to do a Laplace transform on a discontinuous function
I initially wanted to see if piecewise would work. It didn’t. This is the result I get using heaviside to define the areas o...

2 years ago | 0

Answered
Plots multiple lines-of-best-fits instead of just one
The data are missing, so an exact solution is not currently possible. The additional lilne could be that you are plotting bot...

2 years ago | 0

Answered
Data analysis - How to recognize local peaks/different areas?
It would help to have the data. It is relatively straightforward to get the start and end times and then store the relevant d...

2 years ago | 2

| accepted

Answered
Why do i get an error saying "Unrecognized function or variable 'x'."
You have not defined ‘x’ specifically in your calling script prior to calling the function. Try something like this — x = ...

2 years ago | 0

Answered
Trouble importing data from folder
I’m not certain that I understand what you want to do. If you want the number from the file name, perhaps something like thi...

2 years ago | 0

Answered
Linear Algebra Error: Matrix is close to singular or badly scaled.
I am not certain what you want to do. Consider using the pinv function.

2 years ago | 0

| accepted

Answered
How to evaluate an equation with sin and cos at different values in radians.
Vectorise it (note the element-wise operations) — x = [0; pi/2; pi; 3*pi/2]; f = (-0.05-0.01*x)./((5*x+0.3).*cos(x)+(0.2*x.^2...

2 years ago | 1

| accepted

Answered
Problem using tf to perform a transfer function.
You need to have the Control System Toolbox licensed and installed. With that, the code works appropriately — numg=[6 0 1];...

2 years ago | 1

| accepted

Answered
How print the loop iteration value each time to show progress of loop during a run
I am not certain what you want to do, however when I have done something similar, I usually do something like this: k = 12345;...

2 years ago | 0

| accepted

Answered
How do I include legend entries only for an array and not for each line of data?
Create handles for each plot call, and then use the first elements of those handles as the first argument to legend — t = lins...

2 years ago | 1

| accepted

Answered
how to speed ...i need very fast code
Putting the ‘a’ conditional tests outside the loop (and still within the tic-toc block) sppeds it up a bit — LD = load('matlab...

2 years ago | 0

| accepted

Answered
pie chart creation with name (number) and corresponding percentage
One approach — number = [78;79;80;81;82;83;84;85;86;87;88]'; value = [4509;5239;6400;9074;11047;13147;15137;13909;6354;1152;1...

2 years ago | 0

| accepted

Answered
problem with cell array e unique
There are 9 empty cells in ‘RankList’ and they were causing the problem. Try this — LD = load('matlab_RankList.mat') RankL...

2 years ago | 0

| accepted

Answered
Convert string into date
No loop needed. Just use datetime — str = "145601" DT = datetime(str, 'InputFormat',"HHmmss", 'Format','HH:mm:ss') .

2 years ago | 0

| accepted

Answered
How do I make shaded error bar area instead of lines?
It would help to have your data. Perhaps something like this — x = logspace(-10, 5, 150).'; ...

2 years ago | 1

Answered
polynomial fit for a schottky diode and evaluation of its characteristics (ideality factor, barrier height and I0)
It is relatively straightforward to do a nonlinear parameter estimate of the required parameters in MATLAB. Try this — T1 =...

2 years ago | 1

| accepted

Answered
How to extend an array to a new dimension?
One option is the repmat function — a=rand(3, 4); b = zeros([size(a) 5]); for i=1:5 b(:, :, i) = a; end b ...

2 years ago | 1

| accepted

Answered
curve fitting of a nyquist plot
I doubt that there is any direct way to fit it, for example to a nyquist plot. You would have to estimate the system first. T...

2 years ago | 1

| accepted

Answered
Finding uncertainty of a slope
This is straightforward if you have the Statistics and Machine Learning Toolbox. Use regress to get the confidence intervals. ...

2 years ago | 0

Answered
Interpolate data between two specified contours
I am not certain what result you want. The easiest way is probably to use the contour function itself to interpolate. Examp...

2 years ago | 0

| accepted

Answered
how can I show all my output plots from a script at the same time
They probably all occupy the same relative position so they overlap. They are all there, with the later figures covering the e...

2 years ago | 0

Answered
Help IFFT can not restore to original signal after filtering
The fftfilt function can do this relatively efficiently, however since you want to do it manually, try this — %USING REAL SIG...

2 years ago | 0

| accepted

Answered
Error using interp3 "Error using griddedInterpolant. Grid arrays must have NDGRID structure"
The ndgrid function creates gridded data (in 2, 3, ..., n) dimehsions from its argument vectors. Considering the nature of yo...

2 years ago | 0

Answered
Coherence corticomuscular with mscohere
The first output of mscohere is a vector, and is intended to show the magnitude-squared coherence of the two signals. It seems ...

2 years ago | 0

Answered
Dot product of two vector
My pleasure! ‘... how to set the coding if a3.n2 the answer will be in scalar which is 0 and if a3.n3 the answer will be 1 .....

2 years ago | 0

Answered
Operator '*' is not supported for operands of type 'function_handle'
The first time this occurs is here (line 35): Aup = @(xup)((sqrt(xup.^2 + (m1u*Rp)^2)) - (m1u*Rp)) ./ ((sqrt(xup.^2 + (m1u*Rp)...

2 years ago | 0

| accepted

Answered
Some questions about using Least squares for scatter fitting
Depending on how dense the points are and how many you want to fit, it is possible to come up with a reasonable approximation. ...

2 years ago | 0

Answered
I am struggling with integrating a function.
‘How can I fix this?’ Be certain that tthe expression matches the symbolic expression in the figure. (It currently does not....

2 years ago | 0

Answered
Pink noise with specific power P
Create a scaling constant defined by: k = sqrt(DesiredPower / ActualPower) then multiply that by the original vector. Equi...

2 years ago | 0

| accepted

Answered
how can i plot many series of values in the same plot
Looking a bit more carefully at your posted code, I believe the problem is that you are creating a new figure in each loop itera...

2 years ago | 0

| accepted

Load more