Answered
How do I color a scatterplot?
Try this — x1 = 1:10; y1 = rand(size(x1)); x2 = 5:15; y2 = rand(size(x2))+0.5; figure scatter(x1, y1, 50, 'dr', 'fill...

5 years ago | 0

| accepted

Answered
fminsearch with known datas
Try this — % % % f=b*(((c1.*a1.*xin)-(c2.*a2.*xout))/(1+c1.*a1+c2.*a2)); % % % PARMETER MAPPING: c1 = p(1), c2 = p(2), b ...

5 years ago | 0

| accepted

Answered
Vectors must be the same length
I can’t run the code, however I believe the problem is with the legth of ‘w’ (since the call that threw that error is not stated...

5 years ago | 0

Answered
How to apply a filter to a signal?
I do not understand the reason that the Control System Toolbox is being used for signal processing. I would instead use the S...

5 years ago | 0

| accepted

Answered
Problem with installing matlab
Please Contact Support for the most reliable help for installation problems. The installer should create a desktop icon (at l...

5 years ago | 0

Answered
Need help to solve Complex Demodulation problem
‘My problem is -- after low pass filtering amplitude of the demodulated signal (19) becomes 2 times higher than original signal ...

5 years ago | 0

Answered
Plot points with different colors based on another array
Yes. x = rand(100,1); y = rand(100,1); intensity = randi(99,100,1); figure scatter(x, y, 50, intensity, '+') grid c...

5 years ago | 1

| accepted

Answered
Combine 2 matrices into a single column matrix
Yes. A = randi(9,5,1) B = randi(9,6,1) Out = [A; B] EDIT — See the documentation section on MATLAB Operators and Special ...

5 years ago | 0

| accepted

Answered
Curve fitting with custom function
It would help to have the data. I would use the fitnlm function for this — shearRate = logspace(-3, 4, 100); ...

5 years ago | 0

| accepted

Answered
sort and group vectors in a matrix
This is a bit confusing. I would use the pdist2 function for this — x = rand(1,5); y = rand(10,5); X = x(3:5) Y = y(:,...

5 years ago | 0

Answered
I am getting error in this program. Please suggest the corrections.
First, save the function as ‘graph_prog.m’ (note underscore). If I remember correctly, MATLAB .m file names cannot include spac...

5 years ago | 0

| accepted

Answered
I would like to see the spectrogram of x=cos(-250*pi*t^2) for 0<t<2s. How do I plot the spectrogram ( f on y axis, time on x axis)?t = [0,0.1,2]; % Intervall for t y = cos(-2
The frequency of the sine curve is 125 Hz, however the sampling frequency of ‘t’ is 10 Hz. This leads to asliasing and unfortun...

5 years ago | 0

| accepted

Answered
Filling in gaps of missing data with a time series
Change the table to a timetable (table2timetable), then use retime and the 'nearest' method. .

5 years ago | 0

| accepted

Answered
How can I use a logical array to remove and replace values in a corresponding data array?
See if the fillmissing funciton produces the desired result — TF = [0 0 0 0 0 0 0 0 1 0 1...

5 years ago | 1

| accepted

Answered
How do I make Matlab solve for a variable array?
The symbolic solver had problems with it, however fsolve sort of lucked out. Try this numeric approach — sympref('Abbrevi...

5 years ago | 0

Answered
Name Contour levels outside plot
It took longer than expected for me to get this to work. NOTE — It only works for contours that intersect the y-axis on the r...

5 years ago | 1

| accepted

Answered
need help to plot confidence interval
That looks like my code from a very long time ago! If the Statistics and Machine Learning Toolbox is available, use fitlm and...

5 years ago | 0

Answered
How do i plot probability density plot with actual values?
If the distribution function is provided, along with the necessary parameters (none of which are prrovided here), this is straig...

5 years ago | 1

| accepted

Answered
How to signal divide into windows of lengths [1024] .
Use the buffer function. It will do everything desired. signal = 1:100; winlen = 10; ...

5 years ago | 0

Answered
how to find the length of interpolated graph?
The length of the graph (interpolated values) is the length of the interpolation vector ‘xq’ and here is a (1x21) vector. ...

5 years ago | 0

| accepted

Answered
How to calculate Shapley Values
I had no idea that shapley even existed until now, so I have no experience with it. However, one possible problem is that ‘ar...

5 years ago | 0

Answered
How do I sum a vector (row) to a matrix?
This involves a bit of indexing. Note that the rest of ‘A’ is unchnaged, and onlly ‘A(1,:)’ is involved in the operation. ...

5 years ago | 0

| accepted

Answered
displaying different length vector by graph
The only way to do that without using correxponding ‘x’ vectors is to plot them in a loop — y1=[2 5 7]; y2=[1 1 3 4 5 7 8 9];...

5 years ago | 0

Answered
How would you go about solving an equation of the type given?
With one equation in two unknowns, no solution likely exists unless analytic expressions for or (preferably both) exist, or a ...

5 years ago | 0

| accepted

Answered
Harmonic current by using FFT
That looks like it should work, although for the most accurrate results, divide ‘x_fft’ by the row size of ‘x’ or since it is a ...

5 years ago | 0

| accepted

Answered
Line plot not showing up in for loop iteration
I can’t run the code. However it’s obvious that ‘f’ needs to be a vector in order to plot anything other than the markers. C...

5 years ago | 0

| accepted

Answered
how to solve a higher order boundary conditioned differential equation with matlab function
This now runs. One problem was that ‘deriv’ is actually a reserved name, so I changed it. Also the ‘guess’ function was inco...

5 years ago | 0

Answered
R2 between histogram and (weibull) distribution
Try something like this — wblfcn = @(p,x) wblpdf(x,p(1),p(2)); Weibull.Wh_Wp = wblrnd(150, 3, 1, 100); X=linspace(min(Wei...

5 years ago | 0

| accepted

Answered
Z- Transform Problem Confusion
The ztrans function could be useful here — syms n t x(n) X(z) y(n) Y(z) z Eqn1 = y(n) == 2*y(n-2) + y(n) + x(n) Eqz1 = zt...

5 years ago | 1

| accepted

Answered
Pc requirements for MATLAB
See: Platform Road Map for the MATLAB and Simulink Product Families .

5 years ago | 0

Load more