Community Profile # Star Strider

Last seen: Today Active since 2012

Hic sunt dracones!

PROFESSIONAL: Physician (M.D.): Diplomate of the American Board of Internal Medicine; M.Sc. Biomedical Engineering: Instrumentation, Signal Processing, Control, System Identification, Parameter Estimation

NON-PROFESSIONAL: Amateur Extra Class Amateur Radio Operator; Private Pilot, Airplane Single Engine Land, Instrument Rating Airplane; Gamer

NOTE: I do not respond to emails or personal messages, unless they are about my File Exchange contributions.

#### Statistics

All
• • • • • • • • • • • #### Content Feed

View by

Doubt in solving ODE45
It seems that ‘dis’ does not appear anywhere. L=20; v=20;%v (m/sec) T=L/v; tspan_1=[0:0.001:T];%time range y0_1=[0;0];...

etwa 5 Stunden ago | 0

How do you plot a line of constant value on a surface plot?
See if contour3 or contour3m will do what you want. [X,Y,Z] = peaks(30); figure surf(X,Y,Z) hold on contour3(X,Y,Z,[1 1...

etwa 6 Stunden ago | 0

How to properly create function for integration?
There are several problems with the posted code image. First, ‘z’ is not defined anywhere, and it is not an argument to ‘E_fu...

etwa 7 Stunden ago | 0

How can I plot the derivatives of the components of the solution to a system of ODEs?
The only way is to use al loop — tspan = [0 50]; z0=[0.01 0.01 0.01 0.01]; [t,z] = ode45(@(t,z) coupled(t,z), tspan, z0); ...

etwa 11 Stunden ago | 2

| accepted

Cannot calculate integral function
If you want a numeric result, use vpaintegral (introduced in R2016b) instead of int. Not all expressions have analytic integral...

etwa 12 Stunden ago | 0

| accepted

How to convert logarithmic to linear
If you have the Signal Processing Toolbox, use the db2mag function. If you do not have it: dB2mag = @(dB) 10.^(dB/20); ...

etwa 12 Stunden ago | 0

Matlab Polar Plot Legend does not match with the plot
I cannot run that and I amm not certain what you are are plotting. Create a handle for each polarplot call: th = linspace(0, ...

etwa 19 Stunden ago | 0

How to save output of double loop as a matrix?
Since ‘A’ is a matrix, save it as a cell array — for i=1:m for j=1:n A{i,j} = myfunction(...) end end .

ein Tag ago | 1

| accepted

There are NaN values in ‘x’, ‘y’, and ‘sd’. This ia frequent cause of patch failures. Remove them and it works! Try this ...

ein Tag ago | 1

| accepted

3D Sphere projection in Matlab
I worked on this for a while yesterday, without success. Today, I used a relatively straightforward approach that simply flips ...

ein Tag ago | 1

How would I go about writing this equation in matlabs?
There are several options, depending on what you want to do. syms x p(x) = 1/(2*sqrt(sym(pi)))*exp(-(x-5)^2/4) figure f...

2 Tage ago | 0

| accepted

How to save .mat file into hdf5 in matlab?
I have no recent experience with HDF5 files, however the h5write documentation for data indicates that it must be a numeric matr...

2 Tage ago | 0

Error with plotting my function
It works if you give ‘f’ a vector to work with — f = @(x) 2.^x-5*x+2; %Given Function xaxis = [0:0.5:2]; ...

2 Tage ago | 2

| accepted

I am trying to plot an ellipse using a polarplot function.
The polarplot function requires the angular measure to be in radians. Change that in the polarplot call and it works. (The e...

2 Tage ago | 0

| accepted

Am I using corrcoef correctly?
‘Am I using corrcoef correctly?’ Yes, except for squaring the result, and that will produce . H=log([0.01 0.02 0.03 0.04 ...

2 Tage ago | 0

| accepted

Converting a linear equation to decibel
The ‘theta’ vector likely needs to have more points, however that appears to be correct. I use a slightly different approach ...

2 Tage ago | 0

Sampling frequency and correct signal plotting
I believe this is simply an interaction of the sampling frequency and the signal frequency, typically referred to as ‘aliasing’....

2 Tage ago | 0

| accepted

Creating new table from another table
There are several ways to do this, including using the findgroups function. A relatively efficient way is just to do the comp...

3 Tage ago | 0

Amplitude detection in time series data
There are at least two functions you could experiment with, those being findchangepts and ischange. EDIT — (18 Sep 2021 at ...

3 Tage ago | 0

| accepted

How to calculate mantissa of 0.5
I created a little utility function to calculate the mantissa and exponent of a floating-point number a while ago, for my own us...

3 Tage ago | 0

| accepted

How to plot this exponential signal?
The error message is spot on! Use element-wise multiplication ... x=exp(-0.1*t)*sin(0.6*t); ↑ ← HERE so with...

3 Tage ago | 0

rearranging in a matrix
One approach — x = [1 1 0 0 ]; xr = reshape(buffer(x,nnz(x)).', 1, []); xr = xr(1:numel(x)) x = [1 1 1 1 0 0 0]; xr = ...

3 Tage ago | 0

How to calculate volume of surf plot (3d plot) en matlab?
The surf plot arguments are matrices, so use trapz: x = 1:10; y = 1:20; [X,Y] = meshgrid(x,y); z = exp(-((X-5)/5.*(Y-10)/10...

3 Tage ago | 0

| accepted

How to reduce data irregularly?
One approach would be to use the gradient function to calculate the derivative of the available data. This will be greater than...

3 Tage ago | 0

solving a system of ODEs in 3x3 matrix form
The easiest way would be to use the expm function. The expression changes slightly: A = rand(3); b = rand(3,1)...

3 Tage ago | 0

Smoothing a curve and conserving the first and the last value of the curve
Probably the only way to do that is to use the 'SamplePoints' name-value pair, and smooth all but the beginning and end points —...

3 Tage ago | 0

| accepted

10x10x15 matrix integration.
What are ‘X and Y axis’? I would use trapz and approach it as: AXY = A.*X.*Y.*A; Xint = trapz(AXY,1); ...

3 Tage ago | 0

How to plot two equal parts of axis y with unequal distances?
Set the tick locations (and displayed values if different) to specific values, and specify the tick format — x = zeros(1,5); ...

3 Tage ago | 0