Answered

Finding min and max of ODEs

See this example % defining the time range: T=12; trange=[0 T]; % defining initial values (concentrations) for c,s,e i p: c...

Finding min and max of ODEs

See this example % defining the time range: T=12; trange=[0 T]; % defining initial values (concentrations) for c,s,e i p: c...

3 days ago | 0

| accepted

Answered

How to solve "A and B must be floating-point scalars"?

In a symbolic toolbox, you need to use int() instead of integral to find a symbolic integration. Try following code syms v w x ...

How to solve "A and B must be floating-point scalars"?

In a symbolic toolbox, you need to use int() instead of integral to find a symbolic integration. Try following code syms v w x ...

5 days ago | 0

| accepted

Answered

How do I get the equation and display on the graph for line of best fit?

Try this x=[0.200 0.100 0.067 0.050 0.040 0.033 0.025]; y=[0.214 0.158 0.130 0.125 0.136 0.115 0.107]; axis([0 0.025 0 0.02...

How do I get the equation and display on the graph for line of best fit?

Try this x=[0.200 0.100 0.067 0.050 0.040 0.033 0.025]; y=[0.214 0.158 0.130 0.125 0.136 0.115 0.107]; axis([0 0.025 0 0.02...

5 days ago | 1

| accepted

Answered

Not enough input arguments

It seems that you are trying to solve a matrix differential equation. If you are using ode45, one possible way this error can oc...

Not enough input arguments

It seems that you are trying to solve a matrix differential equation. If you are using ode45, one possible way this error can oc...

6 days ago | 0

| accepted

Answered

How can i use 1d signals as input for classification?

If you refer to deep learning-based classification, MATLAB's deep learning toolbox supports the classification of time-series, f...

How can i use 1d signals as input for classification?

If you refer to deep learning-based classification, MATLAB's deep learning toolbox supports the classification of time-series, f...

6 days ago | 0

Answered

How to make animtion of 3D surface plot?

See this example using variable 't'. Adapt it according to your requirement %suface plot; x=-20:1:20; y=-20:1:20; [x,y]=mesh...

How to make animtion of 3D surface plot?

See this example using variable 't'. Adapt it according to your requirement %suface plot; x=-20:1:20; y=-20:1:20; [x,y]=mesh...

8 days ago | 1

| accepted

Answered

How can I solve this question? And the ODE equation made me confused.

See bvp4c() for boundary condition problems. Something like this EI = 1.3e7; q0 = 30e3; T = 20e3; L = 4; xmesh = linspace...

How can I solve this question? And the ODE equation made me confused.

See bvp4c() for boundary condition problems. Something like this EI = 1.3e7; q0 = 30e3; T = 20e3; L = 4; xmesh = linspace...

8 days ago | 1

| accepted

Answered

uiouioiooi rdt gsrd grd gd grdg dg g

See the eig() function: https://www.mathworks.com/help/releases/R2020a/matlab/ref/eig.html to find all the eigenvalues. Use max(...

uiouioiooi rdt gsrd grd gd grdg dg g

See the eig() function: https://www.mathworks.com/help/releases/R2020a/matlab/ref/eig.html to find all the eigenvalues. Use max(...

8 days ago | 2

Answered

how to make a smooth sepectrum??

See smoothdata(): https://www.mathworks.com/help/releases/R2020a/matlab/ref/smoothdata.html. Pass the X_mags vector through smoo...

how to make a smooth sepectrum??

See smoothdata(): https://www.mathworks.com/help/releases/R2020a/matlab/ref/smoothdata.html. Pass the X_mags vector through smoo...

8 days ago | 0

Answered

How to bulid multiple loops with logic operators

You mistakenly typed 1i (imaginary number in MATLAB) instead of i elseif (stress_w1_1(i) > stress_w1_2(1i)) ...

How to bulid multiple loops with logic operators

You mistakenly typed 1i (imaginary number in MATLAB) instead of i elseif (stress_w1_1(i) > stress_w1_2(1i)) ...

8 days ago | 0

| accepted

Answered

Patch color error "Vectors must be the same length."

Using for-loop seems to be the simplest solution in this case. x =[ 1 2 1 2 2 3 2 3]; y =...

Patch color error "Vectors must be the same length."

Using for-loop seems to be the simplest solution in this case. x =[ 1 2 1 2 2 3 2 3]; y =...

8 days ago | 0

Answered

Generating Block Matrix Dynamically

This example show how to use blkdiag to create such a matrix M = [0.7071 0.7071 0.7071 0.7071]; n = 4; M_cell ...

Generating Block Matrix Dynamically

This example show how to use blkdiag to create such a matrix M = [0.7071 0.7071 0.7071 0.7071]; n = 4; M_cell ...

10 days ago | 0

| accepted

Answered

Can anyone help with this error? (I just want to see the contour of the bluish area at the bottom of the image)

You need to specify a single channel image to imcontour(). For example, just provide the blue channel imcontour(I(:,:,3), 3) o...

Can anyone help with this error? (I just want to see the contour of the bluish area at the bottom of the image)

You need to specify a single channel image to imcontour(). For example, just provide the blue channel imcontour(I(:,:,3), 3) o...

10 days ago | 0

Answered

Saving figures with minimum 300dpi in online matlab

Use exportgraphics() to save the figure exportgraphics(gcf, 'test.jpg', 'Resolution', 300) saves currently active figure windo...

Saving figures with minimum 300dpi in online matlab

Use exportgraphics() to save the figure exportgraphics(gcf, 'test.jpg', 'Resolution', 300) saves currently active figure windo...

10 days ago | 2

| accepted

Answered

How can I write this exponential function in matlab

One way to write this is to create an anonymous function f = @(t) 0.2*exp(-1i*(8*pi*t-pi/2))+0.585*exp(-1i*(7*pi*t-deg2rad(78.6...

How can I write this exponential function in matlab

One way to write this is to create an anonymous function f = @(t) 0.2*exp(-1i*(8*pi*t-pi/2))+0.585*exp(-1i*(7*pi*t-deg2rad(78.6...

10 days ago | 0

Answered

How to run an .exe file and open an input .txt file to that

If it accepts through command line as an input argument then you can try this system('C:\NEC-PRO16\BIN\NECWINP.EXE input.txt') ...

How to run an .exe file and open an input .txt file to that

If it accepts through command line as an input argument then you can try this system('C:\NEC-PRO16\BIN\NECWINP.EXE input.txt') ...

10 days ago | 0

Answered

How can I write these functions to the press

You can use ode45() to solve such a system of ODEs. ic = [2; 4]; xspan = [0 1]; [x, Q] = ode45(@odeFun, xspan, ic); y_sol = ...

How can I write these functions to the press

You can use ode45() to solve such a system of ODEs. ic = [2; 4]; xspan = [0 1]; [x, Q] = ode45(@odeFun, xspan, ic); y_sol = ...

11 days ago | 0

Answered

plotting a matrix values as a bar diagram

See boxplot() or boxchart() boxplot(s.') It will show the range of values in each row.

plotting a matrix values as a bar diagram

See boxplot() or boxchart() boxplot(s.') It will show the range of values in each row.

11 days ago | 0

| accepted

Answered

Split table column into multiple columns within the same table based on a specific delimiter

Try this load('Detections.mat'); val = cell2mat(cellfun(@(str) {sscanf(str, '%f,').'}, Click.avrg_spectrum)); new_table = [Cl...

Split table column into multiple columns within the same table based on a specific delimiter

Try this load('Detections.mat'); val = cell2mat(cellfun(@(str) {sscanf(str, '%f,').'}, Click.avrg_spectrum)); new_table = [Cl...

11 days ago | 0

| accepted

Answered

Renaming multiple subfolders within folder

Something like this files = dir('P_6CMBCF_*'); for i=1:numel(files) filename = files(i).name; new_filename = [filena...

Renaming multiple subfolders within folder

Something like this files = dir('P_6CMBCF_*'); for i=1:numel(files) filename = files(i).name; new_filename = [filena...

11 days ago | 1

| accepted

Answered

Is it possible to rewrite these equation set to matrix form?

These variables are nonlinearly related, so not sure how do you want to write in matrix form. Also, it is unlikely that it will ...

Is it possible to rewrite these equation set to matrix form?

These variables are nonlinearly related, so not sure how do you want to write in matrix form. Also, it is unlikely that it will ...

11 days ago | 0

| accepted

Answered

Can I make MATLAB use a custom copy method when creating an array of my class?

It seems like subsasgn() https://www.mathworks.com/help/matlab/ref/subsasgn.html could be helpful in this case. You can control ...

Can I make MATLAB use a custom copy method when creating an array of my class?

It seems like subsasgn() https://www.mathworks.com/help/matlab/ref/subsasgn.html could be helpful in this case. You can control ...

11 days ago | 1

| accepted

Answered

n th Fibonacci number with function

As compared to using for-loop, an alternative approach is to use a closed-form expression of the Fibonacci sequence as given her...

n th Fibonacci number with function

As compared to using for-loop, an alternative approach is to use a closed-form expression of the Fibonacci sequence as given her...

12 days ago | 0

Answered

Saving heatmaps as image

If you are using R2020a, you can use exportgraphics() ans specify the handle of graphic object. n2E = rand(10); % for example ...

Saving heatmaps as image

If you are using R2020a, you can use exportgraphics() ans specify the handle of graphic object. n2E = rand(10); % for example ...

13 days ago | 1

| accepted

Answered

Help me with code to solve for loop to solve ODE

Try this code tspan = [0 500]; ic = [1; 0; 0; 0; 0]; [t, p] = ode45(@odeFun, tspan, ic); plot(t, p) legend({'p', 'p\_dot1...

Help me with code to solve for loop to solve ODE

Try this code tspan = [0 500]; ic = [1; 0; 0; 0; 0]; [t, p] = ode45(@odeFun, tspan, ic); plot(t, p) legend({'p', 'p\_dot1...

14 days ago | 0

| accepted

Answered

Dynamically reading cursor location

You can use the WindowButtonMotionFcn callback of the figure object. Run the following example fig = figure(); ax = axes(fig);...

Dynamically reading cursor location

You can use the WindowButtonMotionFcn callback of the figure object. Run the following example fig = figure(); ax = axes(fig);...

14 days ago | 0

| accepted

Answered

Error using atan2 Inputs must be real.

It gives the value of th4, but the output is in the symbolic format. Convert it into a floating-point value by using double(). C...

Error using atan2 Inputs must be real.

It gives the value of th4, but the output is in the symbolic format. Convert it into a floating-point value by using double(). C...

14 days ago | 0

| accepted

Answered

How to solve higher order nonlinear ode in matlab?

You need to convert the higher-order (say n-th order) ODE equation into a system of n first-order ODE equations. See this exampl...

How to solve higher order nonlinear ode in matlab?

You need to convert the higher-order (say n-th order) ODE equation into a system of n first-order ODE equations. See this exampl...

14 days ago | 2

Answered

Load and do operations for multiple files in a loop

Try something like this filePattern = fullfile('ATA*.mat'); %the 306 files are in the following format ATA 1....306.mat theFil...

Load and do operations for multiple files in a loop

Try something like this filePattern = fullfile('ATA*.mat'); %the 306 files are in the following format ATA 1....306.mat theFil...

14 days ago | 0

| accepted

Answered

how to interpolate nx2 (x,y) matrix include some NaNs with newton's interpolation.

Since all points in x1 are equidistant, therefore, it is not really relevant in the interpolation. You can use fillmissing(): ht...

how to interpolate nx2 (x,y) matrix include some NaNs with newton's interpolation.

Since all points in x1 are equidistant, therefore, it is not really relevant in the interpolation. You can use fillmissing(): ht...

14 days ago | 0

| accepted