Answered
Bode and Nyquist plot rescaling
Use the technique in Obtain Magnitude and Phase Data to get numeric results, then plot those, and similarly for Create Nyquist P...

6 years ago | 0

| accepted

Answered
How to add serialized legends to a chart in MATLAB
See if the Line Properties name-value pair DisplayName will do what you want. Specifically see: Specify Legend Labels During P...

6 years ago | 0

Answered
Diagonal Pattern by writing loops?
Try this: M = diag([ones(1,9) 0 ones(1,9)]); M = M + fliplr(M); M(ceil(size(M,1)/2), ceil(size(M,1)/2)) = 1; figure imag...

6 years ago | 0

| accepted

Answered
Problem to find inflection point
Note that with your data, in order to calculate the inflection points correctly, you need to reverse ‘x’ and ‘y’ in my code: x...

6 years ago | 1

| accepted

Answered
How do I plot two subplots side by side in one figure?
Try this: conRR = [(0:10).' rand(11,5)*80]; % Create Matrix b9RR = [(0:10).' rand(11,5)*80]; ...

6 years ago | 0

| accepted

Answered
how can I give each subplot a different title?
Easiest is to use a cell array, then reference it. Create the titles as: sbpttl = {'0.4mA', '0.6mA', '0.8mA', '1.2mA', '1.6...

6 years ago | 0

| accepted

Answered
how to set the negative values on a diagram to zero
One approach: figure plot( ... ) ylim([0, max(ylim)]) if you only want to limit the y-axis range.

6 years ago | 0

Answered
Error while reading and displaying an image in R2020a
The extension is wrong. Try this: I = imread('rice.png'); figure imshow(I) That worked for me (R2020a).

6 years ago | 0

Answered
Substitute implicit dependent expressions into another one
I would start with this: syms pt Kt Ktstar rm12 dt1 dt2 pm1 pm12 Km am1 am21 dm1 dm12 am12 dm pm Xm12 Xt Xm1=Km*(1-dm/pm)-...

6 years ago | 0

| accepted

Answered
Best method to resample EOG data 50Hz to 256Hz
The resample function is your best option. You are correct. It might be interesting for your own interest to see if there is...

6 years ago | 0

Answered
What's wrong with my code?
Try this: syms a b=2; e=0.9; q=0.4; g=0.6; k=0; d=0.5; % a=1:1:5; N(a) = (q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g) fpi(a)=(b-q*N...

6 years ago | 0

| accepted

Answered
Time normalization of EMG data
Define a time vector that would work for all of them, then use the resample function. See the documentation section for tx, and...

6 years ago | 0

Answered
How to create contour plot with xyz data?
The original vectors do not provide much information. This is likely the best you can do: x=[53 59 62 68]; y=[9.9 9.5 ...

6 years ago | 0

Answered
Matlab freezing up when plotting a piecewise function
It seems that fplot has problems evaluating the piecewise function. The only way to get around that is to create your own anony...

6 years ago | 0

| accepted

Answered
I dont know what I am doing wrong. I keep on getting various error codes ode45 error,
There are two problems: First, In MATLAB, spaces are delimiters, so MATLAB gets confused if there are spaces between operatio...

6 years ago | 0

| accepted

Answered
How to show a seconds plot axis ticks as hh:mm
Try this: X = -10800:10:+10800; tv = seconds(X); signal = sin(2*pi*X/1E+3); % Create Signal fi...

6 years ago | 2

| accepted

Answered
Can someone better explain what the fullfile function does on Matlab (the mathworks explanation didn't help me)?
You don’t have to actually write any files to experiment with it, so create a directory path and a filename and extension (they ...

6 years ago | 0

Answered
How to read line with multiple separate headers and tabs in between values
It would help to have your actual file. What information do you want to import? Obviously you want the matrix data, however ...

6 years ago | 0

| accepted

Answered
How to find the root of a polynomial
Easiest: syms z P(z) = z.^9 + z.^8 - z.^7 + z.^6 - z.^5 + z + 1; rts = vpasolve(P) Otherwise: rts = roots([1 1 -1 1 -1 0...

6 years ago | 0

| accepted

Answered
How can I outline the inside border of this ring? ie. highlight the inner circle
Try this: I = imread('Love Matlab image.jpeg'); IBW = im2bw(I); Bnd = bwboundaries(IBW); figure imshow(IBW) hold on pl...

6 years ago | 0

| accepted

Answered
design band pass filter
Here is prototype code I used for a different project that you can adapt, if you want an IIR filter: Fs = 250; ...

6 years ago | 0

| accepted

Answered
How to manually replicate the bode() gain plot from a transfer function
‘But the actual bode plots should look like this:’ It does. Harkening back to yesterday: syms C R_1 R_2 R_3 L s V_o i omeg...

6 years ago | 2

| accepted

Answered
Obtaining the variance-covariance matrix
That appears to me to be the covariance matrix of the parameters of the linear regression, so in a word, No. The cov function w...

6 years ago | 0

| accepted

Answered
if Loop to print values into a variable
Change the loop slightly, using the two new commented lines: for i = 1: length(r) dBdt =@(t,B) (r(i)).*B.*(1-(B./k)); ...

6 years ago | 1

Answered
regroup identical coordinate pair
I have no idea what your objective is, however the unique function will produce the result you posted: RX = unique(X,'stable')...

6 years ago | 1

| accepted

Answered
load data from doted plot
Try this: F = openfig('case1 SOC noV2G.fig'); h = findobj(F, 'Type','line'); for k = 1:numel(h) x{k} = h(k).XData; ...

6 years ago | 0

| accepted

Answered
How to substitute jw for s in a transfer function in Matlab?
Try this: syms C R_1 R_2 R_3 L s V_o i omega %Equations R_1 = 10; R_2 = 10; R_3 = 10; L = 0.001; C = 2*10^-6; Z_1 = R_...

6 years ago | 2

| accepted

Answered
variable thresholding for peak detection in ecg signal
I’m guessing that your signal has a wandering baseline, so MinPeakHeight is inconsistent with it. If that’s true, you can eithe...

6 years ago | 0

Answered
lsqcurvefit for two different equations and variables
This works, however it only fits one of the curves: y_theo = @(x,xdata) [x(1).*(1+(x(2)./xdata).^(log10(2)/x(3))).^(-x(3)./log...

6 years ago | 0

| accepted

Answered
What is wrong with my filter?
‘Why is it filtering the wrong frequencies in the middle bands?’ First, the sampling frequency of your signal and the samplin...

6 years ago | 0

| accepted

Load more