Answered

dirac() and ode45 issue

I doubt that the dirac call is actually necessary. The code works correctly without it — tspan1 = 0:0.00000001:0.01; x0=...

dirac() and ode45 issue

I doubt that the dirac call is actually necessary. The code works correctly without it — tspan1 = 0:0.00000001:0.01; x0=...

5 days ago | 0

Answered

Trouble with symbolic integrals

Since the desired result is numeric, use vpaintegral — syms x; f = exp((x^2-1)/2)/(1-x^2)^0.5; int_f = vpaintegral(f,-1,1)...

Trouble with symbolic integrals

Since the desired result is numeric, use vpaintegral — syms x; f = exp((x^2-1)/2)/(1-x^2)^0.5; int_f = vpaintegral(f,-1,1)...

5 days ago | 0

Answered

Plot figures in the same figure (MATLAB)

Add the second matrix to the code, concatenate it with ‘H’ along dimension 3, then use a for loop to address and plot them. H...

Plot figures in the same figure (MATLAB)

Add the second matrix to the code, concatenate it with ‘H’ along dimension 3, then use a for loop to address and plot them. H...

5 days ago | 0

| accepted

Answered

How to extract symbolic parts and corresponding constant values with division in symbolic polynomials?

I cannot find any function that would return the desired result, however ther are other options, a few of which are — syms x...

How to extract symbolic parts and corresponding constant values with division in symbolic polynomials?

I cannot find any function that would return the desired result, however ther are other options, a few of which are — syms x...

5 days ago | 0

Answered

How to plot multiple y values for a single x value

The plot function figures this out automatically — A = randn(512,10); x = 1:10; figure plot(x, A, '.') xlim([0 11]) ...

How to plot multiple y values for a single x value

The plot function figures this out automatically — A = randn(512,10); x = 1:10; figure plot(x, A, '.') xlim([0 11]) ...

5 days ago | 0

Answered

INDEX IN POSITION 1 EXCEEDS ARRAY BOUNDS (MUST NOT EXCEED 3)

These — for i = 1 : n Sum = 0; for j = 1 : n should instead be — for i = 1 : size(a,1) ...

INDEX IN POSITION 1 EXCEEDS ARRAY BOUNDS (MUST NOT EXCEED 3)

These — for i = 1 : n Sum = 0; for j = 1 : n should instead be — for i = 1 : size(a,1) ...

5 days ago | 0

| accepted

Answered

find the intersection of the four corner and trim the value out of the corner

Solve for the intersections, then plot to those limits — grid on syms stress1 stress2 shear12 SL_Ts=1800; SL_Cm=1400; ST_T...

find the intersection of the four corner and trim the value out of the corner

Solve for the intersections, then plot to those limits — grid on syms stress1 stress2 shear12 SL_Ts=1800; SL_Cm=1400; ST_T...

5 days ago | 0

| accepted

Answered

Integration of a function having constant parameter

Try this — syms a x F = int((4*a - 2*x + 4*a*x - 3*a*x^2 - 2*a*x^3 + a*x^4 - x^2 + x^3), x, 0, 1) Ffcn = matlabFunction(F) ...

Integration of a function having constant parameter

Try this — syms a x F = int((4*a - 2*x + 4*a*x - 3*a*x^2 - 2*a*x^3 + a*x^4 - x^2 + x^3), x, 0, 1) Ffcn = matlabFunction(F) ...

6 days ago | 1

| accepted

Answered

plot nonlinear equation in x y coordinate

Try something like this — syms x y SL_Ts=1800; SL_Cm=1400; ST_Ts=40; ST_Cm=230; SLT=100; k=((x^2/(SL_Ts^2))-((x*y)/...

plot nonlinear equation in x y coordinate

Try something like this — syms x y SL_Ts=1800; SL_Cm=1400; ST_Ts=40; ST_Cm=230; SLT=100; k=((x^2/(SL_Ts^2))-((x*y)/...

6 days ago | 0

| accepted

Answered

Interpolated contour plot with excel data

I’m guessing as to what ‘x’ and ‘y’ are, however it will be easy to reverse them if I guessed wrong. T1 = readtable('https...

Interpolated contour plot with excel data

I’m guessing as to what ‘x’ and ‘y’ are, however it will be easy to reverse them if I guessed wrong. T1 = readtable('https...

6 days ago | 0

| accepted

Answered

Plot scatter plot as shade

Try this — LD = load('conc.mat'); conc = LD.conc; t=[0;30;60;120;300;600;900]; figure plot(t, conc) hold on shadeWidth...

Plot scatter plot as shade

Try this — LD = load('conc.mat'); conc = LD.conc; t=[0;30;60;120;300;600;900]; figure plot(t, conc) hold on shadeWidth...

6 days ago | 0

| accepted

Answered

please give me answer what is wrong

The differential equaton apparently does not have an analytic solution. Integrating it numerically is an option — syms y(x)...

please give me answer what is wrong

The differential equaton apparently does not have an analytic solution. Integrating it numerically is an option — syms y(x)...

6 days ago | 0

| accepted

Answered

ode89 and ode78 are unrecognized in MATLAB 2021a

From the last line in the ode78 and ode89 documentation — Introduced in R2021b .

ode89 and ode78 are unrecognized in MATLAB 2021a

From the last line in the ode78 and ode89 documentation — Introduced in R2021b .

6 days ago | 1

Answered

Find a y axis increasing point in a plot -

Try something like this — x1 = -2:2; y1 = [0 0 1 0 0]; x2 = linspace(-2, 2); y2 = interp1(x1, y1, x2); [maxy2,idx2] ...

Find a y axis increasing point in a plot -

Try something like this — x1 = -2:2; y1 = [0 0 1 0 0]; x2 = linspace(-2, 2); y2 = interp1(x1, y1, x2); [maxy2,idx2] ...

6 days ago | 0

| accepted

Answered

Error: This statement is incomplete.

I strongly advise against using eval. Put all of the arrays into a cell array, and then address them appropirately — year...

Error: This statement is incomplete.

I strongly advise against using eval. Put all of the arrays into a cell array, and then address them appropirately — year...

6 days ago | 1

Answered

Locating z-values at certain x-values

I am not certain what the desired result is, sp[ecifically finding the ‘z’ values that correspond to ‘x_sea’ or the reverse. ...

Locating z-values at certain x-values

I am not certain what the desired result is, sp[ecifically finding the ‘z’ values that correspond to ‘x_sea’ or the reverse. ...

6 days ago | 0

| accepted

Answered

Weibull distribution plot x-axes scale is wrong

Try something like this — %% Weibull [parmHat, parmCI]=wblfit(Cont_Wh_Wp); scale= parmHat(1); shape=parmHat(2); figure...

Weibull distribution plot x-axes scale is wrong

Try something like this — %% Weibull [parmHat, parmCI]=wblfit(Cont_Wh_Wp); scale= parmHat(1); shape=parmHat(2); figure...

6 days ago | 0

Answered

Find roots of a first order differential equation

Try this — r = 1; x = linspace(-2*pi, 2*pi, 25); y = Function(x,r); zxidx = find(diff(sign(y))); ...

Find roots of a first order differential equation

Try this — r = 1; x = linspace(-2*pi, 2*pi, 25); y = Function(x,r); zxidx = find(diff(sign(y))); ...

6 days ago | 0

| accepted

Answered

Problem with multi-layer antenna design using Antenna Designer

The ‘Index cannot exceed 0’ message indicates that there is nothing in the array being indexed (it is empty, indicating that it ...

Problem with multi-layer antenna design using Antenna Designer

The ‘Index cannot exceed 0’ message indicates that there is nothing in the array being indexed (it is empty, indicating that it ...

6 days ago | 0

Answered

this plot3 looks 2D on live script (pointing downwards as it should), and 3D (pointing sideways for no reason), why?

I cannot run that since the data are missing. However to see it in all its 3D glory, use the view function to rotate the came...

this plot3 looks 2D on live script (pointing downwards as it should), and 3D (pointing sideways for no reason), why?

I cannot run that since the data are missing. However to see it in all its 3D glory, use the view function to rotate the came...

7 days ago | 0

Answered

Array Indexing and Function Handling question.

It would be necessary to define ‘F’ in terms of a single parameter vector — F = @(xy) [3*xy(1)+xy(2).^2 , xy(1).^2+3*xy(1)-1];...

Array Indexing and Function Handling question.

It would be necessary to define ‘F’ in terms of a single parameter vector — F = @(xy) [3*xy(1)+xy(2).^2 , xy(1).^2+3*xy(1)-1];...

7 days ago | 1

| accepted

Answered

How to put endpoint on Bar graph

In R2021b, this is straightforward (and described in Specify Labels at the Ends of Bars). y = [75.8 78.05; 81 80.30; 91 80...

How to put endpoint on Bar graph

In R2021b, this is straightforward (and described in Specify Labels at the Ends of Bars). y = [75.8 78.05; 81 80.30; 91 80...

7 days ago | 1

| accepted

Answered

how can I change my time so that it takes frequency 1/250 hz

If is the sampling interval, multiply it by the sampling instants to convert them to time — C = readtable('https://www.math...

how can I change my time so that it takes frequency 1/250 hz

If is the sampling interval, multiply it by the sampling instants to convert them to time — C = readtable('https://www.math...

7 days ago | 0

| accepted

Answered

How to plot color ball use matlab?

This is an interesting problem! This should get you started — Facets = 40; numPatches = fix(Facets/5); [X,Y,Z] = sphere(F...

How to plot color ball use matlab?

This is an interesting problem! This should get you started — Facets = 40; numPatches = fix(Facets/5); [X,Y,Z] = sphere(F...

7 days ago | 2

| accepted

Answered

split an audio file

Unless it is absolutely necessary to use reshape, use buffer instead. It is just easier. It only operates on one vector at a...

split an audio file

Unless it is absolutely necessary to use reshape, use buffer instead. It is just easier. It only operates on one vector at a...

7 days ago | 1

Answered

matlab font 2021b

There is likely a way to set this programmatically, however the easiest way to change the fonts is to click on Preferences, then...

matlab font 2021b

There is likely a way to set this programmatically, however the easiest way to change the fonts is to click on Preferences, then...

7 days ago | 0

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...

7 days 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...

7 days 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'...

8 days 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...

8 days ago | 0

| accepted