Respondida
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 = ...

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 1

| aceptada

Respondida
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];...

alrededor de 3 años hace | 1

| aceptada

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 1

| aceptada

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 0

| aceptada

Respondida
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).'; ...

alrededor de 3 años hace | 1

Respondida
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 =...

alrededor de 3 años hace | 1

| aceptada

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

alrededor de 3 años hace | 1

| aceptada

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

alrededor de 3 años hace | 1

| aceptada

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

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

Respondida
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)...

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

| aceptada

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

alrededor de 3 años hace | 0

| aceptada

Respondida
Find f if f′′(x) = 4−6x−40x3, f(0) = 2 and f′(0) = 1
Use the Symbolic Math Toolbox. syms f(x) x Df = diff(f); D2f = diff(f,2); This is obviously homework, so I leave the rest...

alrededor de 3 años hace | 0

Respondida
How to generate matrix in MATLAB
Try this — N = 32; C = 33; Wc = exp((1j*2*pi)/C) P = ones(N+1,C); P(2:end,2:end) = Wc.^((1:N)'*(1:C-1)) The approach ...

alrededor de 3 años hace | 0

| aceptada

Respondida
what is wrong with my FFT from a Shaker with accelerometer mounted
I compared your fft code with my stock fft code and got the same result. I believe that the problem is the sampling frequency...

alrededor de 3 años hace | 0

Cargar más