Answered
Surface normal in 3-D
Although I doubt this would work with with symbolic plots without some additional coding, the surfnorm function would be worth e...

4 years ago | 0

Answered
How can I add labels to my scatter plot?
Try something like this — t = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1263190/dataset.xlsx')...

4 years ago | 2

| accepted

Answered
convert matrix steps from 1 to 0.1
Use the linspace function to define the time vector — L = 0.1; % signal Length (sec) F...

4 years ago | 0

Answered
how can I plot an increase and decrease in tempearture as x-axes (i.e. from 25 to 700, 700 to 500 all on x-axes), agains different y-axes
The tiledlayout function can do this in a relatively straightforward manner. LD = load(websave('A','https://www.mathworks.com...

4 years ago | 0

| accepted

Answered
How to design FIR pass-band using a table of gains for frequences range
This might be possible using firpmord, and firpm, or firls. These functions will calculate the filter coefficients. To see wha...

4 years ago | 1

| accepted

Answered
Plot u=f(x,y,z) with all discrete data
The (x,y,z) vector data must be converted into a 2D matrix by some sort of computational magic so the contour can be plotted. ...

4 years ago | 0

| accepted

Answered
Other result accompanying fitted data
I am pleased that you found my code helpful! The code fits only one vector, so it only has one output. To get all the result...

4 years ago | 1

| accepted

Answered
how to filer frequencies?
It is possible to design a FIR ‘comb’ filter to do this. Use the filtfilt function to do the actual filtering. Fs = 4E+4; ...

4 years ago | 0

Answered
add time vector to spectrum
It is not possible to run that (missing data), and nearly impossible to determine what you want to do. It is certainly possib...

4 years ago | 0

Answered
Error using plot vectors must be the same length
Note that ‘z1’ is defined with a +1 default increnent and with a starting value that is greater than its ending value. This mea...

4 years ago | 0

Answered
add 'dd-MMM-yyyy' data to datetime array in form 'HH:mm:ss:SSS' with rollover
I’m not certain how robust this is, however it seems to work in this example — Times = ['23:59:59:873' '23:59:59:893'...

4 years ago | 1

| accepted

Answered
Incorrect use if/else
Perhaps this — cell = {[],[],[]}; cell1 = {rand(1452,2),[],[]}; A = cell{1,1}; B = cell1{1,1}; if isempty(A) B(:,2)...

4 years ago | 0

| accepted

Answered
How to plot the mean value of X corresponding to each Y value?
I am not certain what you want. Perhaps something like this — x = ones(9,1)*linspace(13, 19, 50); ...

4 years ago | 0

| accepted

Answered
Error on using tf function and rlocus
The correct approach to finding potential overshadowing functions or variables is: which -all tf which -all rlocus and shoul...

4 years ago | 0

Answered
How to create a time vector that is incremented between two datetime strings?
It would help to have some idea of what you want to do, and what ‘data’ is (and for good measure ‘data’ itself). Try somethin...

4 years ago | 1

| accepted

Answered
Find period cycle and frequency for signal
Finding the approximate zero-crossings is straightforward, and the subsequent interpolation involves a loop to get the exact zer...

4 years ago | 0

Answered
nonlinear least square optimization
The Symbolic Math Toolbox is not appropriate for this. Use the Optimization Toolbox function lsqcurvefit instead (since you app...

4 years ago | 0

Answered
How to obtain correct frequency and amplitude via FFT
Increase the frequency resolution (I doubled it here, although you can increase it further) with nfft = 2^nextpow2(nt_sign)*2 ...

4 years ago | 0

| accepted

Answered
how could i plot x^2+(y-x^3/2)^2=1 ?
Perhaps this — syms x y m(x,y) = (x^2+(y-x^3/2)^2-1); figure fimplicit(m, [-1 1 -1 1]*1.5) grid axis('equal') xlabel...

4 years ago | 0

Answered
What is the rating of the Parks-McClellan FIR degree?
According to the documentation, the order of the filter is ‘n’ (the first output).

4 years ago | 0

Answered
I want to save [pks,locs] data for every iteration
Since the ‘[pks,locs]’ data may not be the same in every iteration, save them to cell arrays — [pks,locs] = findpeaks(sgf,'min...

4 years ago | 0

| accepted

Answered
Find closest value for each row in timetable
I am defining ‘closest’ as the minimum absolute difference between ‘Var1’ and the last two variables. (My attempt at a more d...

4 years ago | 0

| accepted

Answered
Group data based on direct
One way to do this would be to use the histcounts function and get the first three outputs — WindDir = rand(100,1)*360; edgev...

4 years ago | 0

| accepted

Answered
cannot find existing number
See the documentation section on Floating-Point Numbers for a full explanation. Actually, I can’t reproduce that exact proble...

4 years ago | 0

| accepted

Answered
Plotting amplitude spectrum of a signal
Try something like this — tmax=0.5; t=0:0.001:tmax; fs=1000; tsamp=0:1/fs:tmax; f1 = 18; f2 = 321....

4 years ago | 1

| accepted

Answered
Sort a bank of ECG samples to 2 groups
This is the best I can do for these. They required a significant amount of processing to remove the baseline variation and hi...

4 years ago | 0

| accepted

Answered
How to find THD?
If you’re referring to total harmonic distortion, see the Simscape Electical function ee_calculateThdPercent.

4 years ago | 0

Answered
How do I get rid of the horizontal line on the y-axis in a line plot? Please see attached image below as an example. I want the horizontal line hidden.
Since: [x1,fs1]=audioread('Aniruddha heart beat.wav'); and x1 = 962560*2 the red line is likely the second channel in ‘x1’ ...

4 years ago | 0

| accepted

Answered
Calculate the maximum and minimum values
I thought we covered a version of that in my Comment to your other thread. That dealt with the hour that the daily maximum oc...

4 years ago | 0

| accepted

Answered
Saving data from a for loop (new-ish to MATLAB!)
Save the ‘datatable’ output to a cell array — mn_start=9; %month to start dd_start=11; %day to start date...

4 years ago | 0

| accepted

Load more