Answered

How do I increase the x-axis to make my action potentials bigger

The X-limits need to be reduced in order to show the detail, and the last subplot needs to have its axes rescaled to show the de...

How do I increase the x-axis to make my action potentials bigger

The X-limits need to be reduced in order to show the detail, and the last subplot needs to have its axes rescaled to show the de...

4 dagar ago | 0

| accepted

Answered

Symbolic ODEs aren't symbolic?

Because of the ‘R*s’ terms, the system is nonlinear. The vast majority of nonlinear differential equations do not have analytic...

Symbolic ODEs aren't symbolic?

Because of the ‘R*s’ terms, the system is nonlinear. The vast majority of nonlinear differential equations do not have analytic...

4 dagar ago | 0

| accepted

Answered

How to calculate the duration of data points in days

Try something like this — Data = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/772213/pulses.txt'...

How to calculate the duration of data points in days

Try something like this — Data = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/772213/pulses.txt'...

4 dagar ago | 0

| accepted

Answered

Error in ode45 (line 115) and odearguments (line 90)

There were two errors. First: dydt(2)=y(2)*(1-y(2))*((y(1)*(or*rr-br*re)-ar*rr); ↑ ← EXTRA UNMATCHE...

Error in ode45 (line 115) and odearguments (line 90)

There were two errors. First: dydt(2)=y(2)*(1-y(2))*((y(1)*(or*rr-br*re)-ar*rr); ↑ ← EXTRA UNMATCHE...

4 dagar ago | 0

| accepted

Answered

How to avoid using a loop here?

One approach — N = 5; tic [m,n] = ndgrid(1:N); A = 2*N + 1 - (m + n) toc Compare — tic A = zeros(N); for m = 1:N ...

How to avoid using a loop here?

One approach — N = 5; tic [m,n] = ndgrid(1:N); A = 2*N + 1 - (m + n) toc Compare — tic A = zeros(N); for m = 1:N ...

4 dagar ago | 0

| accepted

Answered

Timeformat from HH:MM:SS to HHMMSS

Try this — time = datetime('12:30:00', 'InputFormat','HH:mm:SS', 'Format','HHmmSS') .

Timeformat from HH:MM:SS to HHMMSS

Try this — time = datetime('12:30:00', 'InputFormat','HH:mm:SS', 'Format','HHmmSS') .

4 dagar ago | 0

Answered

Replace comma with dot after fopen

For MATLAB versions R2019a and later, the readmatrix function permits definition of the 'DecimalSeparator' (see the Text Files O...

Replace comma with dot after fopen

For MATLAB versions R2019a and later, the readmatrix function permits definition of the 'DecimalSeparator' (see the Text Files O...

4 dagar ago | 0

Answered

How to solve an ODE calculating the value of a variable inside a loop?

The problem is: x0 = X(end); so the error only occurs after the first iteration. The solution is: x0 = X(end,:) and thi...

How to solve an ODE calculating the value of a variable inside a loop?

The problem is: x0 = X(end); so the error only occurs after the first iteration. The solution is: x0 = X(end,:) and thi...

4 dagar ago | 1

| accepted

Answered

how can I get the following graph from this data, changes are required in the code

Try something like this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/771138/G2_A.txt', 'Va...

how can I get the following graph from this data, changes are required in the code

Try something like this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/771138/G2_A.txt', 'Va...

5 dagar ago | 0

| accepted

Answered

How can i make my ODE graph make sense?

The fplot call is incorrect, and the function declines so quickly that it’s not possible to see it clearly with a time interval ...

How can i make my ODE graph make sense?

The fplot call is incorrect, and the function declines so quickly that it’s not possible to see it clearly with a time interval ...

5 dagar ago | 1

| accepted

Answered

Is it possible to save ECG waveform data as an text file with RR-intervals?

I am not certain what the desired result is. Try this — EKGsig = readmatrix('https://www.mathworks.com/matlabcentral/answer...

Is it possible to save ECG waveform data as an text file with RR-intervals?

I am not certain what the desired result is. Try this — EKGsig = readmatrix('https://www.mathworks.com/matlabcentral/answer...

5 dagar ago | 0

Answered

Legend not matching the data

It is possible to label the individual plots in the plot calls. See Specify Legend Labels During Plotting Commands for detail...

Legend not matching the data

It is possible to label the individual plots in the plot calls. See Specify Legend Labels During Plotting Commands for detail...

5 dagar ago | 0

| accepted

Answered

Solving system of coupled ode using ode45

The NaN values are the result of the initial conditions all being 0. With a bit of cheating (setting the initial conditions all...

Solving system of coupled ode using ode45

The NaN values are the result of the initial conditions all being 0. With a bit of cheating (setting the initial conditions all...

5 dagar ago | 0

Answered

Torque ripple plot in MATLAB

Try something like this — t = linspace(0, 720, 1000); s = [sind(2.5*t); sind(2.5*t+180)]; figure plot(t,s, '--') hold ...

Torque ripple plot in MATLAB

Try something like this — t = linspace(0, 720, 1000); s = [sind(2.5*t); sind(2.5*t+180)]; figure plot(t,s, '--') hold ...

6 dagar ago | 0

Answered

what changes are needed

Try this — F = openfig('Manav Divekar untitled.fig'); F.Visible = 'off'; % Don't...

what changes are needed

Try this — F = openfig('Manav Divekar untitled.fig'); F.Visible = 'off'; % Don't...

6 dagar ago | 0

Answered

How to create a table to show the results of a function code?

Subscript the variables so they are column vectors, then put them in the table and return the table as one of the outputs (or pe...

How to create a table to show the results of a function code?

Subscript the variables so they are column vectors, then put them in the table and return the table as one of the outputs (or pe...

6 dagar ago | 0

| accepted

Answered

Function keeps running into errors when I call it

Try this instead — hpeakt = sorteddata.data(:,1); wpeakt = sorteddata.data(:,5); [phivalues] = findphases(wpeakt,hpeakt)...

Function keeps running into errors when I call it

Try this instead — hpeakt = sorteddata.data(:,1); wpeakt = sorteddata.data(:,5); [phivalues] = findphases(wpeakt,hpeakt)...

6 dagar ago | 0

| accepted

Answered

converting sym function to string MATLAB

Try this — syms x y eqn = x^2+2*x*y+3*y^2; partial_eqn = diff(eqn, x); fprintf("The partial derivative of %s w.r.t. x is...

converting sym function to string MATLAB

Try this — syms x y eqn = x^2+2*x*y+3*y^2; partial_eqn = diff(eqn, x); fprintf("The partial derivative of %s w.r.t. x is...

6 dagar ago | 1

| accepted

Answered

Use results in the definition of my functions

Try this instead — function pv=p(X,x) pv=X(1)*x.^2+X(2)*x+X(3); end Here, ‘X’ are the parameters and ‘x’ is the variabl...

Use results in the definition of my functions

Try this instead — function pv=p(X,x) pv=X(1)*x.^2+X(2)*x+X(3); end Here, ‘X’ are the parameters and ‘x’ is the variabl...

6 dagar ago | 0

| accepted

Answered

Could someone please explain me this code?

That looks like something I wrote! It would be helpful to know the context (I don’t remember where I posted it), however it a...

Could someone please explain me this code?

That looks like something I wrote! It would be helpful to know the context (I don’t remember where I posted it), however it a...

7 dagar ago | 1

| accepted

Answered

Integrating a 2nd order ODE

This is a boundary value problem. Use bvp4c to solve it. syms y(x) x L Y q(x) = 2*cos(pi*x/L); Dy = diff(y); D2y = diff(...

Integrating a 2nd order ODE

This is a boundary value problem. Use bvp4c to solve it. syms y(x) x L Y q(x) = 2*cos(pi*x/L); Dy = diff(y); D2y = diff(...

7 dagar ago | 0

| accepted

Answered

How can I call half of text by using "textread" ? (1*4096 matrix to 1*2048 matrix)

I have never used textread, however that could be described in the format string, for example — formatStr = [repmat('%f',1,204...

How can I call half of text by using "textread" ? (1*4096 matrix to 1*2048 matrix)

I have never used textread, however that could be described in the format string, for example — formatStr = [repmat('%f',1,204...

7 dagar ago | 0

| accepted

Answered

I don't understand what this means or how to do it

I would imagine that ‘the next question’ wants the result at some very large valur of ‘t’, however that assumes that the fractio...

I don't understand what this means or how to do it

I would imagine that ‘the next question’ wants the result at some very large valur of ‘t’, however that assumes that the fractio...

7 dagar ago | 0

Answered

my fminsearch function doesn't get the optimum values

The fminsearch function searches for a minimum. To get a maximum, negate the function — [x,fval] = fminsearch(@(x)-tut2(x),[1...

my fminsearch function doesn't get the optimum values

The fminsearch function searches for a minimum. To get a maximum, negate the function — [x,fval] = fminsearch(@(x)-tut2(x),[1...

7 dagar ago | 1

| accepted

Answered

plotting a for loop returns Empty Graph

I’m not certain what you want, however it is necessary to subscript the varialbes to be plotted. This runs without error and ...

plotting a for loop returns Empty Graph

I’m not certain what you want, however it is necessary to subscript the varialbes to be plotted. This runs without error and ...

7 dagar ago | 0

Answered

Area between three curves

Try this — I created the comparisons as ‘>=’ so change those to simply ‘>’ ito make the comparisons strictly ‘greater than’. ...

Area between three curves

Try this — I created the comparisons as ‘>=’ so change those to simply ‘>’ ito make the comparisons strictly ‘greater than’. ...

7 dagar ago | 0

Answered

Hi, I want to know knee point of a curve including the process of by 2nd derivative. Can anyone help by creating the script.

Use the gradient function to calculate the numerical derivative — x = linspace(0, 10); y = exp(-0.1*x) .* sin(x); D1 = g...

Hi, I want to know knee point of a curve including the process of by 2nd derivative. Can anyone help by creating the script.

Use the gradient function to calculate the numerical derivative — x = linspace(0, 10); y = exp(-0.1*x) .* sin(x); D1 = g...

7 dagar ago | 0

Answered

I have to use Fourier Transform without frequency range?

One approach — A = [1 0.43 0.95]; B = [0.97 0.43 0.97]; [h,t] = impz(B,A); figure subplot(2,1,1) plot(t, h) grid ...

I have to use Fourier Transform without frequency range?

One approach — A = [1 0.43 0.95]; B = [0.97 0.43 0.97]; [h,t] = impz(B,A); figure subplot(2,1,1) plot(t, h) grid ...

8 dagar ago | 0

| accepted

Answered

Turn multiple columns into one column

The code is a bit difficult to follow. I’m guessing here that you want to save the ‘allfrequency’ vectors. allfrequency(s,:)...

Turn multiple columns into one column

The code is a bit difficult to follow. I’m guessing here that you want to save the ‘allfrequency’ vectors. allfrequency(s,:)...

8 dagar ago | 0