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

circa 3 anni fa | 1

| accettato

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 1

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

circa 3 anni fa | 1

| accettato

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

circa 3 anni fa | 1

| accettato

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

circa 3 anni fa | 1

| accettato

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

circa 3 anni fa | 0

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

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

circa 3 anni fa | 0

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

circa 3 anni fa | 0

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

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

circa 3 anni fa | 0

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

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

circa 3 anni fa | 0

| accettato

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

circa 3 anni fa | 0

Risposto
how to assign a numerical value to an image based on the gray scale present in the image
I am not certain what you want, however the imhist function may help calculate it. This approach does a simple linear regress...

circa 3 anni fa | 0

Risposto
How to color or patch the region between a curve and the x axis
I posted this in response to your Comment (I’ve since deleted my responding Comment), so I’m now posting it as an Answer here — ...

circa 3 anni fa | 0

| accettato

Risposto
spectrogram unit change from dB/Hz to linear scale
If you want dB rather than dB/Hz, use the pspectrum function with the 'spectrogram' option argument. To get magnitude from dB...

circa 3 anni fa | 0

Risposto
Why doesn't timezone work with datetime
The timezone function is from the Mapping Toolbox, and its results are not compatible with the datetime function. The otherwise...

circa 3 anni fa | 1

| accettato

Risposto
Why damping amplitude the amplitude shifting position of y azis
It would help to have the file to demonstrate with it, however that may not be absolutely necessary. The signal in the file (...

circa 3 anni fa | 0

| accettato

Risposto
Evaluating a complex equation
Preallocate ‘Y’ as: Y=zeros(8,numel(t)); add a second dimension to ‘Y’ in the assignment to it: Y(n,:) = ... and add ‘t’ t...

circa 3 anni fa | 0

| accettato

Carica altro