Community Profile

# David Wilson

### Auckland University of Technology

100 total contributions since 2011

View details...

Contributions in
View by

i am trying to made a code to int the numbers of time i want
Remove the z=x^2 from the loop. syms x n y z a; n= 5 z=x^2; for y=1:n z=int(z) end

3 months ago | 1

| accepted

How to obtain regression polynomial equation with more than 2 independent variables with degree 5.
OK, the fitting is easy, the plotting less so. Since you didn't give us too many hints, not did you give us any data to work wit...

4 months ago | 2

| accepted

Text keeps going behind topographic map
Your mountains are covering the text (as they should). So you need to write your text above the highest peak, so that it is seen...

4 months ago | 0

| accepted

function to produce line graph
I would strongly suggest you don't try a polynomial fit here. From the context (which you neglected to tell us), I suspect that ...

4 months ago | 0

| accepted

creating a transfer function from a determinant
How about: [num,den] = numden(G_vel) G_vel_tf = tf(sym2poly(num), sym2poly(den))

8 months ago | 0

| accepted

Problem Calculating Nonlinear Indefinite Integral
Since you neglected to tell us values for a and b, I'll just set them to a=2 and b=1. You have also two definitions for g(x), so...

8 months ago | 0

| accepted

Plot electric potential distribution
Well I kind of get what you want, but you do seem to have a singularity at the origin when r=0. p = 1; sig = 1; % constants th...

9 months ago | 1

fitting scatter data into multiple cosine functions
Yes, but it is always tricky to fit such sinusoids without good starting estimates. I'm going to use lsqcurvefit from the optimi...

10 months ago | 0

Question

Is the Moving Variance block in Simulink vectorised?
I'm using the Moving Variance block in Simulink and it seems to be giving unexplained results for vectorised (muxed) inputs. My ...

10 months ago | 0 answers | 0

### 0

2D Convolution - Sobel Filter. What is wrong?
Here's my (old) code for a sobel filter: img = imread('Davis_Hall.jpg'); % 'Davis_Hall.jpg':color image X =double(rgb2gray(i...

11 months ago | 0

Related to Matlab Step Comment
You are possibly confusing the closed loop response with the open loop. The closed loop gain is 1/4, so the error is 1-1/4 = 3/4...

11 months ago | 1

| accepted

how to solve matrix differential equation
Here's my attempt: M = [ 97227/21875, 0, 82269/109375, 0, 67311/43750, 0, -97227/218750, 0; ... 0, 97227/21875, 0, 822...

12 months ago | 1

From Fir2 output to transfer function
tr_fun should be a discrete transfer function, (not continuous) say tr_fun=tf(BF,1,1); % Generate a DISCRETE Transfer Function...

12 months ago | 0

How to identify corners of data plotted to estimate data between corners
How about using interp1 with the 'pchip' option? You did speculate the interpolation is overly complex, but then again it is onl...

1 year ago | 1

| accepted

How I can find co ordinates of intersection of two curves ?
Oh, looks like this is a common question: See (from 2016)https://au.mathworks.com/matlabcentral/answers/318475-how-to-find-the-i...

1 year ago | 1

Iterative Method of solving multiple variables without using the curvefit tool
Here's my attempt at fitting uusing lsqcurvefit from the optimisation toolbox. First I generate some synthetic data to subsequ...

1 year ago | 0

how can i calculate the angle of each gradient and x axis?
You could always differentiate to get the slope and then take the arc-tan. syms x real s = 1/(1 + exp(-2*(x-4))) dsdx = dif...

1 year ago | 0

Extracting the daily time series from a text file to a single column
A quick hack is: fname = 'D59.txt' Flow = []; fid=fopen(fname); Yr = 2012; R = []; while 1 tline = fgetl(fi...

1 year ago | 0

| accepted

How to Rearrange data?
Try something like the following: First read in the data file (which I've called numData.txt). I've used your test data above. ...

1 year ago | 0

| accepted

(Food for Thought) Peak Detection on ECG signal
OK, here's my (ugly) solution (withou using findpeaks). I've re-named your data set, and did some pre-processig. load ecg y =...

1 year ago | 0

| accepted

Simulating a FIR filter
Use the filter command. In this case your denominator, (A), coefficients are just 1. x = [ 0 0 0 1 1 1 1 1 ]' % input b = [...

1 year ago | 1

| accepted

Obtain input knowing output and transfer function
Since you have a simple transfer function, here's what I would do. (1) First generate some data that we will subsequently try ...

1 year ago | 0

curve fitting of non linear data for strain-time of creep experiment
Here's my attempt: load data1 t = time; e = strain; plot(t,e) %% Now try curve fit creep = @(p, t) p(1)*(1-exp(-p...

1 year ago | 0

| accepted

Trouble with time delay differential equation
I've only made one small change to your function. You have tried to index a non-integer number back, but the "Z" variable holds ...

1 year ago | 0

How can I simultaneously solve for these equations?
If you have the symbolic toolbox, a straight forward approach works, although it takes some time ... % ODE propblem syms B...

1 year ago | 0

Error when using ode15
It is good practice to try and avoid globals, but rather pass them as auxilary variables into the function. Fao = 1487.351; % ...

1 year ago | 0

| accepted

Plotting Step Response of a Differential Equation
You are close to a viable solution. Solve for an analytical solution, then make it a Matlab (anonymous) function with matlabFunc...

1 year ago | 0

Runge-Kutta 4th order method
First up, you will need a much smaller step size to get an accurate solution using this explicit RK4 (with no error control). I ...

1 year ago | 0

| accepted

How to draw Fig. 1 from the attached pdf with this code
I didn't bother draw the other 3 lines, but you just ned to make the necessary changes to gamma for that. If you run somethi...

1 year ago | 0

| accepted