Answered

How to plot in 3D a given set of data

I would do something like this — x=[0:700:10800]; y=[0:770:11000]; [Xm,Ym] = ndgrid(x, y); Zm = griddata(x, y, z, Xm, Ym); ...

How to plot in 3D a given set of data

I would do something like this — x=[0:700:10800]; y=[0:770:11000]; [Xm,Ym] = ndgrid(x, y); Zm = griddata(x, y, z, Xm, Ym); ...

4 dagar ago | 1

| accepted

Answered

how plot two figures on same axis with two different origin points

If the x-axis is the same for both curves, while one curve has the origin (I assume this means the 0 value on the y-axis) at dif...

how plot two figures on same axis with two different origin points

If the x-axis is the same for both curves, while one curve has the origin (I assume this means the 0 value on the y-axis) at dif...

4 dagar ago | 1

Answered

3D surface plot change origin of axis?

Perhaps — cs = cs - min(cs); Since ‘cs’ is likely a matrix, that will need to be changed to conform to the dimensions of ‘cs’...

3D surface plot change origin of axis?

Perhaps — cs = cs - min(cs); Since ‘cs’ is likely a matrix, that will need to be changed to conform to the dimensions of ‘cs’...

4 dagar ago | 0

Answered

Rebuild PDFs from original data

The is not an option for histfit or the others, however calculating the parameters is straightforward — LD = load('data.mat')...

Rebuild PDFs from original data

The is not an option for histfit or the others, however calculating the parameters is straightforward — LD = load('data.mat')...

5 dagar ago | 0

Answered

Why can't I put the 1x3 matrix into 1x3 variable?

Try this — buf = [1 2 3] buf = num2cell(buf) [a b c] = buf{:} .

Why can't I put the 1x3 matrix into 1x3 variable?

Try this — buf = [1 2 3] buf = num2cell(buf) [a b c] = buf{:} .

5 dagar ago | 2

Answered

a system of non-linear equations (using fsolve in a loop)

Pass them as extra parameters. See Passing Extra Parameters for details. This appears to work — % Crating Solved Varia...

a system of non-linear equations (using fsolve in a loop)

Pass them as extra parameters. See Passing Extra Parameters for details. This appears to work — % Crating Solved Varia...

5 dagar ago | 0

| accepted

Answered

Trying to plot, no figure comes up

I suspect that the problem is that you simpoly need to call it correctly. The function must be at the end of the file, if it is...

Trying to plot, no figure comes up

I suspect that the problem is that you simpoly need to call it correctly. The function must be at the end of the file, if it is...

5 dagar ago | 0

| accepted

Answered

How to determine how much RAM is available?

The memory function is the only option I’m aware of that would come close to providing that information. There are related func...

How to determine how much RAM is available?

The memory function is the only option I’m aware of that would come close to providing that information. There are related func...

5 dagar ago | 0

Answered

How can I use fmisearch() to evaluate the parameters in a matrix?

If the objective is to determine the parameter at a zero-crossing (root), use fsolve or fzero, not fminsearch. Try something ...

How can I use fmisearch() to evaluate the parameters in a matrix?

If the objective is to determine the parameter at a zero-crossing (root), use fsolve or fzero, not fminsearch. Try something ...

5 dagar ago | 0

| accepted

Answered

How to fix legend error??

Try this — K=1.38065e-23; %Boltzman Constant q=1.602e-19; ...

How to fix legend error??

Try this — K=1.38065e-23; %Boltzman Constant q=1.602e-19; ...

6 dagar ago | 0

| accepted

Answered

How to Store Time constant from "damp"

The is relatively easy to calculate — s = tf('s'); H = (s^2 - 2*s - 5) / (s^3 + 5*s^2 - 7*s - 20); damp(H) ...

How to Store Time constant from "damp"

The is relatively easy to calculate — s = tf('s'); H = (s^2 - 2*s - 5) / (s^3 + 5*s^2 - 7*s - 20); damp(H) ...

6 dagar ago | 0

| accepted

Answered

Cosine of an angle

Experiment with vpasolve, and specifically Specify Ranges of Solutions .

Cosine of an angle

Experiment with vpasolve, and specifically Specify Ranges of Solutions .

6 dagar ago | 0

Answered

0.14*100~=14

Not a bug! See Floating-Point Numbers for a detailed discussion.

0.14*100~=14

Not a bug! See Floating-Point Numbers for a detailed discussion.

6 dagar ago | 1

| accepted

Answered

Format exponent notation: start with 0

I am not certain what you are asking. I wrote a little utility function for my own use a while back to do something like this...

Format exponent notation: start with 0

I am not certain what you are asking. I wrote a little utility function for my own use a while back to do something like this...

6 dagar ago | 0

Answered

Getting incorrect plot – curve does not cross the x axis correctly

The roots are [0 2], so use those with the poly function: rts = [0 2]; coefs = poly(rts) figure fplot(@(x) x.^2 - 2.*x, [-5...

Getting incorrect plot – curve does not cross the x axis correctly

The roots are [0 2], so use those with the poly function: rts = [0 2]; coefs = poly(rts) figure fplot(@(x) x.^2 - 2.*x, [-5...

6 dagar ago | 1

Answered

How can I split the columns of my text file as separate variables with textscan?

‘I do not want to take headings into account so I tried to use 'commentstyle'.’ The HeaderLines argument would likely be a be...

How can I split the columns of my text file as separate variables with textscan?

‘I do not want to take headings into account so I tried to use 'commentstyle'.’ The HeaderLines argument would likely be a be...

6 dagar ago | 0

Answered

Function runs in one script but not another ?

Vectorise its calculation, then call it — conc function[] = conc() v = 0.00001 ; D = 0.0000001 ; t = 86400 ; X = 0 :...

Function runs in one script but not another ?

Vectorise its calculation, then call it — conc function[] = conc() v = 0.00001 ; D = 0.0000001 ; t = 86400 ; X = 0 :...

6 dagar ago | 0

Answered

How to make this contour plot like this ??

Increase the numnber of contours. See Contours at Ten Levels for an illustration.

How to make this contour plot like this ??

Increase the numnber of contours. See Contours at Ten Levels for an illustration.

7 dagar ago | 0

Answered

error using integral function

‘but in directly i is depending on t because v is depending on t and y is depending on v’ True, however integral has no way o...

error using integral function

‘but in directly i is depending on t because v is depending on t and y is depending on v’ True, however integral has no way o...

7 dagar ago | 0

Answered

How to graph equations with different x domains?

First, code it correctly, then use logical indexing — t = linspace(0, 110); x1 = @(t) -10000*exp(-0.05*t) + 10000; x2 = @(t)...

How to graph equations with different x domains?

First, code it correctly, then use logical indexing — t = linspace(0, 110); x1 = @(t) -10000*exp(-0.05*t) + 10000; x2 = @(t)...

7 dagar ago | 0

| accepted

Answered

How do I pass the signal through a low-pass FIR filter?

if ‘h’ are the numerator vector of the filter (and the filter is designed correctly) — signal_filtered = filtfilt(h, 1, signal...

How do I pass the signal through a low-pass FIR filter?

if ‘h’ are the numerator vector of the filter (and the filter is designed correctly) — signal_filtered = filtfilt(h, 1, signal...

7 dagar ago | 1

Answered

problem with ode45 solving

Assuming both functions are functions of time — syms x(t) v(t) u = sym(1); ode1 = diff(x) == v ode2 = diff(v) == u [x(t)...

problem with ode45 solving

Assuming both functions are functions of time — syms x(t) v(t) u = sym(1); ode1 = diff(x) == v ode2 = diff(v) == u [x(t)...

7 dagar ago | 1

| accepted

Answered

Lsqcurvefit and ode45 to fit data to system of differential equations

Note that neither ‘x’ or ‘t’ are explicity arguments to ‘Testv3Solver’, so nothing is passed to it and nothing ever changes — ...

Lsqcurvefit and ode45 to fit data to system of differential equations

Note that neither ‘x’ or ‘t’ are explicity arguments to ‘Testv3Solver’, so nothing is passed to it and nothing ever changes — ...

7 dagar ago | 0

| accepted

Answered

Solving coupled second order differential equations using ODE

None of the variables you are passing to ‘ftotal’ have been defined numerically (at least in the posted code). They need to b...

Solving coupled second order differential equations using ODE

None of the variables you are passing to ‘ftotal’ have been defined numerically (at least in the posted code). They need to b...

8 dagar ago | 0

Answered

How do I calculate power for each signal?

Use the buffer function to segment the signal into 1-second increments. Since you want 1-second samples, the vector length is s...

How do I calculate power for each signal?

Use the buffer function to segment the signal into 1-second increments. Since you want 1-second samples, the vector length is s...

8 dagar ago | 1

| accepted

Answered

How to find what values of a and b give the minimum value in the sum

This is a relatively straightforward optmisation problem. Try this — x = randn(20,1); ...

How to find what values of a and b give the minimum value in the sum

This is a relatively straightforward optmisation problem. Try this — x = randn(20,1); ...

8 dagar ago | 0

Answered

fopen error using text file

Use the fullfile function to build the complete path.

fopen error using text file

Use the fullfile function to build the complete path.

8 dagar ago | 0

Answered

How can I get the transfer function?

Using the Symbolic Math Toolbox is likely not appropriate here. Try this instead — s = tf('s'); G = (-3.2*s^2 - 2.9*s -0.0...

How can I get the transfer function?

Using the Symbolic Math Toolbox is likely not appropriate here. Try this instead — s = tf('s'); G = (-3.2*s^2 - 2.9*s -0.0...

8 dagar ago | 0

Answered

Array indices must be positive integers or logical values.

There were problems with indexing ‘freqArray’ and then ‘toneArray’. See if this does what you want — ...

Array indices must be positive integers or logical values.

There were problems with indexing ‘freqArray’ and then ‘toneArray’. See if this does what you want — ...

8 dagar ago | 0

Answered

how to get the plot from function

Uncomment this hold call — figure(1) plot(x1,u) % hold on N2=21 u=poisson(N2) and the code does what you want. N...

how to get the plot from function

Uncomment this hold call — figure(1) plot(x1,u) % hold on N2=21 u=poisson(N2) and the code does what you want. N...

8 dagar ago | 0

| accepted