Beantwortet
how find optimal threshold?
I am not certain what you are asking. The ‘threshold’ as illustrated would be the mean (or median) of the selected normal dis...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
State-space system identification using known states, inputs, outputs
I generally use lsim rather than sim. Looking through the sim documentation for opt, the simOptions function has a way to speci...

fast 4 Jahre vor | 0

Beantwortet
ss dont work properly
The ‘A’ and ‘B’ matrices contain symbolic variables. Use the subs function to assign numeric values to them, and then the dou...

fast 4 Jahre vor | 0

Beantwortet
Add trend line to scatter plot with years in the X-axis
I am not certain what the data are. Assuming originally a datetime array and a double vector, try something lilke this — Da...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Calculate area of inside polygon using inpolygon
There are Mapping Toolbox functions areaint and similar functions to do this. Those might be more appropriate. Follow the link...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
Methods for smoothing contour lines
I dislike going to external sites. Increasing ‘N’ would be the option I would use, initially experimenting with 250 and perha...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
histogram of datetimes with customisable bin width
After doing a few conversions between datetime and duration to get all the arguments to be what the functions want — % input ...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
surf plot of custom data
The data are all matrices. Unless I’m missing something, just plot them — LD1 = load(websave('X','https://www.mathworks.com...

fast 4 Jahre vor | 0

Beantwortet
Carve a Pumpkin in MATLAB
I’m not certain what sort of ‘carved look’ you’re going for. With respect to drawing lines on the surface, one approach would b...

fast 4 Jahre vor | 0

Beantwortet
How to add a single legent with multiple subplots with out overlapping on plots?
An alternative — Z = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1161928/Excel.xlsx', 'VariableN...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
polyfit returning coefficients in order of ascending power (opposite of documentation)
I get different results — a = [0 1 2 3]; b = [0 1 2 3]; coeff = polyfit(a,b,1) eval = polyval(coeff,a) This is entirely co...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to solve an ODE with three equation that are dependent on each other
Some of this is difficult to interpret. My best guess at a solution — v1=0.3; k2 = 0.3; %constant C = v1; % C = v1-dpdt;...

fast 4 Jahre vor | 0

Beantwortet
Accumarray for two functions?
The accumarray approach is certainly possible — v = randn(250,1) Out = accumarray(ones(size(v)), v, [], @(x){{mean(x) std(x)}...

fast 4 Jahre vor | 2

Beantwortet
how to plot different plots in the same MATLAB figure to compare time domain specification if the state space representation is given below
Perhaps — A = [-300 0 0 0 0 0; 0 -300 0 0 0 0; 0 0 0 0 1 0; 0 0 0 0 0 1; 10.7206 -9.5648 10.7206 -9.5648 0 0; -9.5648 10.7...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
how to plot the gradient of a equation having specific region?
Perhaps this — syms x y f(x,y)=-5*x^3+4*y*x+6*y^3+1 Gf = gradient(f,x) figure fsurf(Gf, [-2 2 -2 2]) xlabel('X') ...

fast 4 Jahre vor | 0

Beantwortet
Reading in a text file with numbers and strings in
It would help to haved the file. The readtable function would likely be best for this, since it will also import the variable...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Extract numbers from char type
Probably the easiest way — s = '4.64 km'; c = regexp(s, '\d*\.\d*|\d*', 'match') n = str2double(c) EDIT — (18 Oct 2022 at...

fast 4 Jahre vor | 2

| akzeptiert

Beantwortet
Shift lables for x and y axis on a graph
Perhaps xticklabels (although it takes a bit of experimenting to get it to work) — figure pcolor(rand(30)) xtl = xticklabels...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Selecting a line of data from a 3D surface
I would use griddedInterpolant for this — x = linspace(-1, 1, 25); y = linspace(0, 5, 35); [X,Y] = ndgrid(x, y); Z = exp(-...

fast 4 Jahre vor | 0

Beantwortet
plot a vertical line on datetime axis of a time series
Perhaps — dt = 1E-2; % Create Data ndp = 1E+4; ...

fast 4 Jahre vor | 0

Beantwortet
design filter to implement in microcontroller
An IIR filter would be more efficient, and an elliptic filter the most efficient of those. The designfilt function may be the e...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to extract values at particular interval ?
Try something like this — A = randi(9,3,4,48) B = randi([11 19], 1, 48) iv = 1:4:48 ...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to extract number from this string cell?
Try something like this — C = [") injection-dr0015:138751)" ") injection-dr0015:68761)" ") injection-dr0015:122762...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
I get Error using zeros Size inputs must be integers when I change h to be 0.8 or larger. How can I fix that?
I am not certain what you want to do. One option is to divide ‘t’ by ‘h’ — f = @(t,v) (-v*3*t)/(1+t)+2*(1+t)^3*exp(-t); a ...

fast 4 Jahre vor | 0

Beantwortet
Synchronising two different signals
I got this far, however I have no idea what you want to do with them at this point — % clear % close all % datapathECG = %Da...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Solution of a system of ODEs by means of bvp4c
The singlular Jacobian was likely the result of the ‘(1/r)’ term, since ‘r’ initially begins at 0. While changing that removed ...

fast 4 Jahre vor | 0

Beantwortet
How to remove a certain value from all entries of a vector
You can remove the offset and the trend with a highpass (or bandpass) filter. (Use bandpass if you want to elimiinate high-freq...

fast 4 Jahre vor | 0

Beantwortet
Discrete input signal and continuous transfer function
It would likely be best to convert the continuous-time transfer function to a discrete-time transfer function (ideally using the...

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
Align two plots based on amplitude
Perhaps something like this — t = linspace(0, 10, 1000); y1 = sin(2*pi*t/2.5) + randn(size(t))*0.1; y2 = 1.5*sin(2*pi*t/2.5)...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Finding Unknown Parameters from Monod Equations
The estimated value for ‘theta(1)’ definitely does not appear to be as expected for a rate constant, however if it is than it ...

fast 4 Jahre vor | 0

| akzeptiert

Mehr laden