Community Profile

# Star Strider

##### Last seen: Today
13,135 total contributions 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.

View details...

Contributions in
View by

anonymous function and plotting
You are essentially where you want to be. It helps to assign the output of your function to a different variable. (I use ‘v’ h...

2 hours ago | 0

| accepted

How to change ASCII values?
You are not using tthe result of the upper call. See if: u = upper(k) y = double(u) is more appropriate.

1 day ago | 0

How to vary a value inside an integral which is not getting integrated itself?
The integral2 and integral3 functions do not allow the 'ArrayValued' name-value pair, so it is necessary to ‘nest’ integral call...

1 day ago | 0

how to get best 10 fitness values
If you have R2017b or later, mink would be easiest. Otherwise, use sort and take the first 10. (This assumes that ‘fitness’ is...

1 day ago | 0

stem fuction shows error everytime
You have a script file that you named ‘stem’. This is called ‘overhsadowing’ a MATLAB function. The solution is to find the ...

1 day ago | 0

Plotting two functions on 3D surface for the same interval
Try this: x = 0:10; Z1=x.^2; Z2=x.^3; figure surf(Z1.'*Z2) Another possibility: figure surf([Z1; Z2]) It is not cer...

2 days ago | 0

| accepted

Extract values common to 5 columns
Since it is not homework, see if this does what you want: A = randi(9,20,5); % Create Mat...

2 days ago | 0

How to use a vector to index another vector?
Testing the code (without the function definition or function call): t = (0:0.1:15); in = sin(t*2*pi); w = 5; out = in*0;...

2 days ago | 0

how can i work with two variables with genetic algorithm
It would be helpful to know what your fitness function is doing. If there are independent variables, you can combine them as:...

2 days ago | 0

I want to generate a time vector
start = datetime('6:30 AM', 'InputFormat','h:mm a'); finish = datetime('3:00 PM', 'InputFormat','h:mm a'); interval = minutes(...

2 days ago | 0

| accepted

Is there a way to set the xticklabel text alignment
The example in Specify x-Axis Tick Values and Labels appear to be centre-aligned.

3 days ago | 0

If elseif else statement inside a loop

3 days ago | 0

NaN issue when calculating for a mean value
The NaN result is due to one or more elements of the vector you are taking the mean of being (0/0) or (Inf/Inf), since they eval...

3 days ago | 0

Least squares regression of a quadratic without bx term.
Try this: DM = [x(:).^2 ones(size(x(:)))]; % Design Matrix B = DM \ y(:); ...

3 days ago | 0

| accepted

FFT analysis of multiple signals with the same response length
The fft function operates column-wise (unless the argument is a vector or you tell it otherwise), so this is all that is necessa...

3 days ago | 0

| accepted

solving differential equation and assigning value to symfun
Try this: t_val = vpasolve(ySol==1,t) % Symbolic Solution

3 days ago | 0

| accepted

Solving for a variable in equation
Use a root-finding function (I chose fzero here), then take the known variable values, create an anonymous function from the exp...

4 days ago | 0

| accepted

How to find data values that falls on line connecting loglog plot in matlab
To get a smooth interpolation, it is necessary to do two transformations on it. First, interpolate log(y), and then take the ex...

4 days ago | 0

| accepted

Magnitude, row and column in a Matrix
Try this: A = [87.97 87.97 17.97 95.22 87.96 91.26 75.50 75.50 75.50 78.13 64.89 78.90]; ...

4 days ago | 0

| accepted

How to solve non linear system of ODE
If you are fitting the differential equations to data, see Monod kinetics and curve fitting and Parameter Estimation for a Syste...

4 days ago | 0

How do I obtain the derivatives after interp2 with the 'spline' option?
To get a numerical derivative, use the gradient function. With a matrix input, request two outputs. See Contour Plot of Vect...

4 days ago | 0

| accepted

How to plot a two variable function?
Apparently ‘x’ is a vector. That means that ‘z’ produces only two values. You could plot it as: figure plot(z, 'p') howe...

4 days ago | 0

Easiest way to skip a few lines and then read data from this text file ( x and y) to draw a plot.
The easiest way I can think of is to use the dlmread function: filename = '6in_nomass_5.txt'; Data = dlmread(filename, '\t', ...

4 days ago | 0

| accepted

X,Y data of irregular grid, scatter plot with Z data
It is not obvious to me what you want. You already appear to have tried reshape, although I have no idea what the arguments ...

4 days ago | 0

| accepted

How do I synchronize stress-strain data?
If you want both of them to have the same sampling frequency, use the resample function on one of them. That will make the proc...

4 days ago | 0

How to find the best parameters to fit damped oscillations curves
See: How to filter noise from time-frequency data and find natural frequency of a cantilever? Specifically: D = load('Lo...

4 days ago | 1

| accepted

fminsearch for fitting a function to experimental data
There are several errors in the posted code, as Walter noted, mostly involving implicit multiplication, that MATLAB does not rec...

4 days ago | 0

Interpolate Data and find the matching x-Value
Try this: data=[1 2, 2 3, 3 3, 4 5, 7 9]; xval = @(yval) fsolve(@(x) interp1(data(:,1...

4 days ago | 0

| accepted

Why ('t=(2x+1)/(2x-2)','x') is unsolvable?
Correct syntax: syms t x solve(t==(2*x+1)/(2*x-2),x) producing: ans = (2*t + 1)/(2*t - 2)

5 days ago | 0

| accepted