Answered

Error while integrating bessel functions

The problem is: Q = @(s) 2*(1 - (nu.^2))./(s.*E).*(1./(a(s) + b(s))); ↑ ↑ ← HER...

Error while integrating bessel functions

The problem is: Q = @(s) 2*(1 - (nu.^2))./(s.*E).*(1./(a(s) + b(s))); ↑ ↑ ← HER...

4 días ago | 0

| accepted

Answered

EEMD(ensemble EMD)

I am not absolutely certain what the problem is, because ‘does not work’ can mean just about anything. Note that according to...

EEMD(ensemble EMD)

I am not absolutely certain what the problem is, because ‘does not work’ can mean just about anything. Note that according to...

4 días ago | 0

| accepted

Answered

conditioning array with complex number

This can probably be combined into fewer actual lines. I kept them separate to demonstrate the approach — A = complex(rand(...

conditioning array with complex number

This can probably be combined into fewer actual lines. I kept them separate to demonstrate the approach — A = complex(rand(...

4 días ago | 0

| accepted

Answered

frequency of letters in English message

One approach — plain= 'my name is samah samir and i am engineer'; ltrs = double(plain); ltrs = ltrs(ltrs>32)-double('a')+1; ...

frequency of letters in English message

One approach — plain= 'my name is samah samir and i am engineer'; ltrs = double(plain); ltrs = ltrs(ltrs>32)-double('a')+1; ...

4 días ago | 0

| accepted

Answered

Change "matrix" to a scalar

If you want to square the elements of ‘var’ use element-wise exponentiation (the ‘dot operator’). var=var*(1-(1/(i-1)))+i*(sum1...

Change "matrix" to a scalar

If you want to square the elements of ‘var’ use element-wise exponentiation (the ‘dot operator’). var=var*(1-(1/(i-1)))+i*(sum1...

4 días ago | 0

Answered

How to set scale range for a contour?

The x-axis goes from 1 to 2 because the contour plot is of a (117x2) matrix. That also explains the range of the y-axis. d...

How to set scale range for a contour?

The x-axis goes from 1 to 2 because the contour plot is of a (117x2) matrix. That also explains the range of the y-axis. d...

5 días ago | 0

| accepted

Answered

How to make constant to 1 in power function in curve fitting toolbox

Use fminsearch rather than linearised polyfit for this. x1=[6.71214E-05 0.00112676 0.047319082 0.142706219 0.273947664 0.4...

How to make constant to 1 in power function in curve fitting toolbox

Use fminsearch rather than linearised polyfit for this. x1=[6.71214E-05 0.00112676 0.047319082 0.142706219 0.273947664 0.4...

5 días ago | 1

| accepted

Answered

How to use create table name variables in loop?

I am not certain that I understand what you want to do. Perhaps — randomdata = randn(33,10); NrCellArrays = fix(size(rando...

How to use create table name variables in loop?

I am not certain that I understand what you want to do. Perhaps — randomdata = randn(33,10); NrCellArrays = fix(size(rando...

5 días ago | 0

| accepted

Answered

How to code and build a smaller array and 2D-plot charged particles to make clusters (as they are linked via indices) using charge, no of lone pair of electrons & bond order?

I am not certain what you want. I have no idea what ‘collecting the indices’ implies. Try this — T1 = readtable('https://w...

How to code and build a smaller array and 2D-plot charged particles to make clusters (as they are linked via indices) using charge, no of lone pair of electrons & bond order?

I am not certain what you want. I have no idea what ‘collecting the indices’ implies. Try this — T1 = readtable('https://w...

5 días ago | 0

Answered

How can I plot an histogram?

Try something like this — number_of_events=[30.60, 32.30, 32.30, 32.30, 32.30, 2.60, 12.60, 32.30, 32.30, 9.70, 25, 13.20, 1...

How can I plot an histogram?

Try something like this — number_of_events=[30.60, 32.30, 32.30, 32.30, 32.30, 2.60, 12.60, 32.30, 32.30, 9.70, 25, 13.20, 1...

6 días ago | 0

| accepted

Answered

What equivalent MATLAB commands plots PDF of data like 'hist' command plots histogram of data.

See if the histfit function does what you want. .

What equivalent MATLAB commands plots PDF of data like 'hist' command plots histogram of data.

See if the histfit function does what you want. .

6 días ago | 0

| accepted

Answered

How can I make MATLAB shade the area of the virtual intersection between two lines?

Both fill and patch require a closed region — x1 = ones(1,10); y1 = ones(1,1000000); n1 = 10^10:10000000000:10^16; T1 = 10:...

How can I make MATLAB shade the area of the virtual intersection between two lines?

Both fill and patch require a closed region — x1 = ones(1,10); y1 = ones(1,1000000); n1 = 10^10:10000000000:10^16; T1 = 10:...

6 días ago | 1

| accepted

Answered

stop execution of code to check results

I would just display it instead — if i == 100000 fprintf('Parameter = %f at iteration %d\n', Parameter, i) end Also...

stop execution of code to check results

I would just display it instead — if i == 100000 fprintf('Parameter = %f at iteration %d\n', Parameter, i) end Also...

6 días ago | 0

| accepted

Answered

simulate free fall project, ode45, using reynolds no to get drag coefficient, recursive problem

The NaN values are the result of 0/0 operations, and when that occurs in the first integration, it propagates through all of the...

simulate free fall project, ode45, using reynolds no to get drag coefficient, recursive problem

The NaN values are the result of 0/0 operations, and when that occurs in the first integration, it propagates through all of the...

6 días ago | 0

| accepted

Answered

Default varm function not working

The function is part of the Econometrics Toolbox, so to use it, the Toolbox must be licensed and installed. If it is already ...

Default varm function not working

The function is part of the Econometrics Toolbox, so to use it, the Toolbox must be licensed and installed. If it is already ...

7 días ago | 0

Answered

How can I plot single points, each having a different color, of two arrays(as x, and y) using a for loop?

See the documentation on scatter to see all its optional arguments and features. x = rand(12,1); y = rand(12,1); figure...

How can I plot single points, each having a different color, of two arrays(as x, and y) using a for loop?

See the documentation on scatter to see all its optional arguments and features. x = rand(12,1); y = rand(12,1); figure...

7 días ago | 0

Answered

How can I extend the data in the x direction.

Try this — y5000 = feval(f, 5000) I cannot run the posted code (no data) so I am posting this as UNTESTED CODE. It shoul...

How can I extend the data in the x direction.

Try this — y5000 = feval(f, 5000) I cannot run the posted code (no data) so I am posting this as UNTESTED CODE. It shoul...

7 días ago | 0

| accepted

Answered

how to store array

Try something like this — xv=1:5; for k = 1:numel(xv) x = xv(k); A=[5*x 0;2*x^2 1]; B=[0;2.55]; Y(:,x)=...

how to store array

Try something like this — xv=1:5; for k = 1:numel(xv) x = xv(k); A=[5*x 0;2*x^2 1]; B=[0;2.55]; Y(:,x)=...

7 días ago | 0

| accepted

Answered

How to replace diagonal of square matrices within a cell array?

The easiest way is to subtract the diagonal of each matrix from the matrix — C = {rand(4); rand(4); rand(4)} Cr = cellfun...

How to replace diagonal of square matrices within a cell array?

The easiest way is to subtract the diagonal of each matrix from the matrix — C = {rand(4); rand(4); rand(4)} Cr = cellfun...

7 días ago | 0

| accepted

Answered

How do I fit a gaussian to a bar plot and extract the variance of the gaussian?

One approach — x=[8,11,8,10,8,21,26,33,28,8,17,7,4,10,12]; y=1:15; [fitobject,gof]=fit(y',x','gauss1'); figure bar(y,x) ...

How do I fit a gaussian to a bar plot and extract the variance of the gaussian?

One approach — x=[8,11,8,10,8,21,26,33,28,8,17,7,4,10,12]; y=1:15; [fitobject,gof]=fit(y',x','gauss1'); figure bar(y,x) ...

7 días ago | 0

| accepted

Answered

why my matlab didn't plot anything?

The plot call plots points here, so it is necessary to plot markers. The plot funciton draws lines between points, so its argum...

why my matlab didn't plot anything?

The plot call plots points here, so it is necessary to plot markers. The plot funciton draws lines between points, so its argum...

7 días ago | 1

Answered

How to extract certain values from text file to find average of the group of numbers?

Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/734899/Sujata%20Dhar%20%20text%20fil...

How to extract certain values from text file to find average of the group of numbers?

Try this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/734899/Sujata%20Dhar%20%20text%20fil...

7 días ago | 0

| accepted

Answered

Can only find one double angle formula of cos(2x).

Experiment with various options to get at least one more identity — syms x f(x) = cos(2*x) f1 = expand (f) f2 = rewrite(f,...

Can only find one double angle formula of cos(2x).

Experiment with various options to get at least one more identity — syms x f(x) = cos(2*x) f1 = expand (f) f2 = rewrite(f,...

8 días ago | 0

Answered

ODE solver (45) giving two solutions (i.e. two plots) for an ODE! How do I plot only the one I need?

Use element-wise division H2= (k^2*(V+Y(:,3)+Y(:,4)))./(3-((k^2/2).*Y(:,2).^2)) ↑ ← HERE then ‘H2...

ODE solver (45) giving two solutions (i.e. two plots) for an ODE! How do I plot only the one I need?

Use element-wise division H2= (k^2*(V+Y(:,3)+Y(:,4)))./(3-((k^2/2).*Y(:,2).^2)) ↑ ← HERE then ‘H2...

8 días ago | 1

| accepted

Answered

steady state responce of LTI system

Try this — A=[-0.0295 0.0478 0 -9.81;-0.1777 -1.4411 120 0;0.0005 -0.033 -1.5345 0;0 0 1 0] B=[0;-12.81;-6.59;0] C=[0 0 0 ...

steady state responce of LTI system

Try this — A=[-0.0295 0.0478 0 -9.81;-0.1777 -1.4411 120 0;0.0005 -0.033 -1.5345 0;0 0 1 0] B=[0;-12.81;-6.59;0] C=[0 0 0 ...

8 días ago | 0

| accepted

Answered

How do I solve this error?

The value of ‘Ea’ in the exponential call makes the integral effectively zero of all the values of ‘V’. LD = load('V[1].mat...

How do I solve this error?

The value of ‘Ea’ in the exponential call makes the integral effectively zero of all the values of ‘V’. LD = load('V[1].mat...

8 días ago | 0

| accepted

Answered

adding each element of a matrix by previous elements of that row.

Try this — a = [1 2 3;4 5 6;7 8 9] acs = cumsum(a,2) b = acs ./ (1:size(a,2)) ratsb = rats(b) Experiment to get differ...

adding each element of a matrix by previous elements of that row.

Try this — a = [1 2 3;4 5 6;7 8 9] acs = cumsum(a,2) b = acs ./ (1:size(a,2)) ratsb = rats(b) Experiment to get differ...

9 días ago | 1

| accepted

Answered

How do I only highlight the decreasing portion of the green in the plot with the find function?

The vector in the plot image (or the code to create it) are not available, so I substituted my own. This should get you star...

How do I only highlight the decreasing portion of the green in the plot with the find function?

The vector in the plot image (or the code to create it) are not available, so I substituted my own. This should get you star...

9 días ago | 0

Answered

Arrow of a vector ( r, theta) from a point (x,y).

One approach (using the quiver function) — x = rand y = rand r = rand theta = 30; ...

Arrow of a vector ( r, theta) from a point (x,y).

One approach (using the quiver function) — x = rand y = rand r = rand theta = 30; ...

9 días ago | 2

| accepted

Answered

Label the actual data points in y-axis

One approach — x = linspace(0, 10, 5); yl = 250*(1-exp(-0.5*x)); [xr,yr] = stairs(x,yl/17); figure yyaxis left plot...

Label the actual data points in y-axis

One approach — x = linspace(0, 10, 5); yl = 250*(1-exp(-0.5*x)); [xr,yr] = stairs(x,yl/17); figure yyaxis left plot...

9 días ago | 1

| accepted