Answered
plot in logarithmic scale
The contourf function plots a plane, not a surface. To plot logarithmic contours of the ‘Z’ matrix, it will be necessary to c...

4 years ago | 0

| accepted

Answered
How to plot an equation with different parameter value?
Try this — x = 0:0.01:+10; c = [1;1.1;1.4;0.3]; Y = (1-x.^2).^c; figure plot(x,Y) legend(compose('c = %.1f',c), 'Locati...

4 years ago | 1

| accepted

Answered
How do you plot RMS of a Colormap?
Depending on the desired result, either use the rms function with the entire matrix (using the (:) convention to force it to be ...

4 years ago | 0

Answered
Excel sheet time data defaulting to January 1st, 1970 on plot
My best guess is that datetime is not interpreting the time column correctly. It would need to be something like this: time...

4 years ago | 1

| accepted

Answered
Calculation of prediction interval for a new observation
The code is not doing a regression, so the ±95% confidence intervals on the vector would be the confidence intervals on the mean...

4 years ago | 0

Answered
How to simply record a string of sound from the computer microphone?
The audiorecorder , recordblocking and audioplayer functions could be helpful. .

4 years ago | 0

Answered
Using temperature and pressure data to estimate antoine coefficients for glycerol
Since both variable are present in the objective function equation, nlinfit (or lsqcurvefit) are not really good choices for thi...

4 years ago | 1

Answered
IIR Filter Coefficant Value
I do not have access to R2010b and I have no idea what application that is. I would design the filter a bit differently, usin...

4 years ago | 0

Answered
How to make circle in matrix form
I am not certain what th desired result is. This is the best I can do — k = 10; M = zeros(k); v = 0:0.2:k-2; x = ceil(...

4 years ago | 0

Answered
how can i create an amplitude sweep?
Try these — t = linspace(0, 10, 500); s = sin(2*pi*t*10); figure subplot(3,1,1) plot(t, s) grid ylim([-10 10]) titl...

4 years ago | 0

| accepted

Answered
Is there a mistake in my code?
I might be better to estimate the parameters directly — x = [2.5 6 9]; % Exce...

4 years ago | 0

| accepted

Answered
Problem adding the large number with small number
The addition is made. It is necessary to display the appropriate precision to see it — a=6.3276e+16 b=17.3304 a_plus_b = ...

4 years ago | 0

| accepted

Answered
fcontour and fplot showing distorted images...
Separate the real and imag parts of the function and it works — syms k a b x e=exp(sym(1)); assume (a>0); %a=6; z(k,a)=(...

4 years ago | 1

| accepted

Answered
How can I determine the medium bias between 2 signals
The question is definitely ambiguous, since the signals themselves are neither displayed nor described. Perhaps subtracting t...

4 years ago | 0

| accepted

Answered
Why do I receive this error when using cumsum: "Invalid data type. First input argument must be numeric or logical." ?
The code (that appears to have been written in 2001) doesn’t make sense! The first argument to the function is ‘file_name’ th...

4 years ago | 0

Answered
How to get multiple circles to rotate about a point
Try something like this — a = linspace(0, 2*pi, 30); r = 1:3; cm = colormap(turbo(numel(r))); figure for k1 = 1:numel(...

4 years ago | 0

Answered
Struggling to plot the data over timestamps!
I am resisting the temptation to copy all of those, that should be in a text or spreadsheet file and attached here, anyway. I...

4 years ago | 0

| accepted

Answered
What should be the X, Y, and Z axes while plotting the contour plot?
If ‘sigmaX’, ‘sigmaY’ and ‘sigmaXY’ are vectors, use the griddata to create a matrix from them that can be plotted. Example —...

4 years ago | 1

| accepted

Answered
How can I fix this error?
The problem is that ‘G’ is a system object, not a matrix. To use smithForm on the ‘A’ matrix — Ad = [-3 5 -7 0; 0.5 -1.5 0.5 ...

4 years ago | 0

| accepted

Answered
How to generate a signal
I would use the interp1 function — x = linspace(0, 0.015, 41); % Independent Variable y = randn(size(...

4 years ago | 0

| accepted

Answered
I don't know what this genetic algorithm output graph means :(
The documentation describnes it better than I can, so I refer you to the documentation section on Plot Options. It describes al...

4 years ago | 0

Answered
How to calculate the largest difference between peaks?
The findpeaks function can produce the ‘prominence’ value of each peak as the fourth output, p. I would use that value to deter...

4 years ago | 0

Answered
Can anyone help me identify what is wrong with this code
Try this instead — for i=2:length(arr) diff(i) = arr(i) - arr(i-1) %I keep getting an error on line 4 end Be sure that ...

4 years ago | 1

| accepted

Answered
Real part of the Fast Fourier Transformed data file.
‘Any suggestions what might be the reason, do I have a mistake in the code?’ The code appears to be reasonable, although with...

4 years ago | 0

Answered
error: fzero: zero point is not bracketed
Use fzero for numeric functions and solve for symbollic functions — syms x f=4*x.^2+20*x+4 x=vpa(solve(f==0)) format long...

4 years ago | 0

Answered
Cumtrapz in a table does not work with datetime
Use the datenum function to convert the dates and times to decimal days and decimal fractions of days to use as the ‘x’ vector i...

4 years ago | 0

Answered
bilinear interpolation of a 3D graph
Missing data, so I can’t run the code to demonstrate the approach. Since the data appear to be gridded (not scattered), the g...

4 years ago | 0

| accepted

Answered
How do I put peaks, prominences, widths and location in an array
Since ‘prominence’ is the first output of that particular findpeaks call, it has the values of the peaks, not their locations (t...

4 years ago | 0

| accepted

Answered
Trying to open/read a .xlsx file in MATLAB
The type function will display the contents of a file. The disp function (or simply removing the trailing semicolon from the ...

4 years ago | 0

| accepted

Answered
Separating numbers and letters
One approach — Coords = cell2mat(compose('%.1fN',rand(1,5)*100).') % Create Column ReadNrs = cell2mat(textscan(...

4 years ago | 0

| accepted

Load more