Answered

Cannot calculate integral function

If you want a numeric result, use vpaintegral (introduced in R2016b) instead of int. Not all expressions have analytic integral...

Cannot calculate integral function

If you want a numeric result, use vpaintegral (introduced in R2016b) instead of int. Not all expressions have analytic integral...

5 days ago | 0

| accepted

Answered

How to convert logarithmic to linear

If you have the Signal Processing Toolbox, use the db2mag function. If you do not have it: dB2mag = @(dB) 10.^(dB/20); ...

How to convert logarithmic to linear

If you have the Signal Processing Toolbox, use the db2mag function. If you do not have it: dB2mag = @(dB) 10.^(dB/20); ...

5 days ago | 0

Answered

Matlab Polar Plot Legend does not match with the plot

I cannot run that and I amm not certain what you are are plotting. Create a handle for each polarplot call: th = linspace(0, ...

Matlab Polar Plot Legend does not match with the plot

I cannot run that and I amm not certain what you are are plotting. Create a handle for each polarplot call: th = linspace(0, ...

6 days ago | 0

Answered

How to save output of double loop as a matrix?

Since ‘A’ is a matrix, save it as a cell array — for i=1:m for j=1:n A{i,j} = myfunction(...) end end .

How to save output of double loop as a matrix?

Since ‘A’ is a matrix, save it as a cell array — for i=1:m for j=1:n A{i,j} = myfunction(...) end end .

6 days ago | 1

| accepted

Answered

Shaded Standard Deviation Corridors

There are NaN values in ‘x’, ‘y’, and ‘sd’. This ia frequent cause of patch failures. Remove them and it works! Try this ...

Shaded Standard Deviation Corridors

There are NaN values in ‘x’, ‘y’, and ‘sd’. This ia frequent cause of patch failures. Remove them and it works! Try this ...

6 days ago | 1

| accepted

Answered

3D Sphere projection in Matlab

I worked on this for a while yesterday, without success. Today, I used a relatively straightforward approach that simply flips ...

3D Sphere projection in Matlab

I worked on this for a while yesterday, without success. Today, I used a relatively straightforward approach that simply flips ...

6 days ago | 1

Answered

How would I go about writing this equation in matlabs?

There are several options, depending on what you want to do. syms x p(x) = 1/(2*sqrt(sym(pi)))*exp(-(x-5)^2/4) figure f...

How would I go about writing this equation in matlabs?

There are several options, depending on what you want to do. syms x p(x) = 1/(2*sqrt(sym(pi)))*exp(-(x-5)^2/4) figure f...

7 days ago | 0

| accepted

Answered

How to save .mat file into hdf5 in matlab?

I have no recent experience with HDF5 files, however the h5write documentation for data indicates that it must be a numeric matr...

How to save .mat file into hdf5 in matlab?

I have no recent experience with HDF5 files, however the h5write documentation for data indicates that it must be a numeric matr...

7 days ago | 0

Answered

Error with plotting my function

It works if you give ‘f’ a vector to work with — f = @(x) 2.^x-5*x+2; %Given Function xaxis = [0:0.5:2]; ...

Error with plotting my function

It works if you give ‘f’ a vector to work with — f = @(x) 2.^x-5*x+2; %Given Function xaxis = [0:0.5:2]; ...

7 days ago | 2

| accepted

Answered

I am trying to plot an ellipse using a polarplot function.

The polarplot function requires the angular measure to be in radians. Change that in the polarplot call and it works. (The e...

I am trying to plot an ellipse using a polarplot function.

The polarplot function requires the angular measure to be in radians. Change that in the polarplot call and it works. (The e...

7 days ago | 0

| accepted

Answered

Am I using corrcoef correctly?

‘Am I using corrcoef correctly?’ Yes, except for squaring the result, and that will produce . H=log([0.01 0.02 0.03 0.04 ...

Am I using corrcoef correctly?

‘Am I using corrcoef correctly?’ Yes, except for squaring the result, and that will produce . H=log([0.01 0.02 0.03 0.04 ...

7 days ago | 0

| accepted

Answered

Converting a linear equation to decibel

The ‘theta’ vector likely needs to have more points, however that appears to be correct. I use a slightly different approach ...

Converting a linear equation to decibel

The ‘theta’ vector likely needs to have more points, however that appears to be correct. I use a slightly different approach ...

7 days ago | 0

| accepted

Answered

Sampling frequency and correct signal plotting

I believe this is simply an interaction of the sampling frequency and the signal frequency, typically referred to as ‘aliasing’....

Sampling frequency and correct signal plotting

I believe this is simply an interaction of the sampling frequency and the signal frequency, typically referred to as ‘aliasing’....

7 days ago | 0

| accepted

Answered

Creating new table from another table

There are several ways to do this, including using the findgroups function. A relatively efficient way is just to do the comp...

Creating new table from another table

There are several ways to do this, including using the findgroups function. A relatively efficient way is just to do the comp...

8 days ago | 1

| accepted

Answered

Amplitude detection in time series data

There are at least two functions you could experiment with, those being findchangepts and ischange. EDIT — (18 Sep 2021 at ...

Amplitude detection in time series data

There are at least two functions you could experiment with, those being findchangepts and ischange. EDIT — (18 Sep 2021 at ...

8 days ago | 0

| accepted

Answered

How to calculate mantissa of 0.5

I created a little utility function to calculate the mantissa and exponent of a floating-point number a while ago, for my own us...

How to calculate mantissa of 0.5

I created a little utility function to calculate the mantissa and exponent of a floating-point number a while ago, for my own us...

8 days ago | 0

| accepted

Answered

How to plot this exponential signal?

The error message is spot on! Use element-wise multiplication ... x=exp(-0.1*t)*sin(0.6*t); ↑ ← HERE so with...

How to plot this exponential signal?

The error message is spot on! Use element-wise multiplication ... x=exp(-0.1*t)*sin(0.6*t); ↑ ← HERE so with...

8 days ago | 0

Answered

rearranging in a matrix

One approach — x = [1 1 0 0 ]; xr = reshape(buffer(x,nnz(x)).', 1, []); xr = xr(1:numel(x)) x = [1 1 1 1 0 0 0]; xr = ...

rearranging in a matrix

One approach — x = [1 1 0 0 ]; xr = reshape(buffer(x,nnz(x)).', 1, []); xr = xr(1:numel(x)) x = [1 1 1 1 0 0 0]; xr = ...

8 days ago | 0

Answered

How to calculate volume of surf plot (3d plot) en matlab?

The surf plot arguments are matrices, so use trapz: x = 1:10; y = 1:20; [X,Y] = meshgrid(x,y); z = exp(-((X-5)/5.*(Y-10)/10...

How to calculate volume of surf plot (3d plot) en matlab?

The surf plot arguments are matrices, so use trapz: x = 1:10; y = 1:20; [X,Y] = meshgrid(x,y); z = exp(-((X-5)/5.*(Y-10)/10...

8 days ago | 0

| accepted

Answered

How to reduce data irregularly?

One approach would be to use the gradient function to calculate the derivative of the available data. This will be greater than...

How to reduce data irregularly?

One approach would be to use the gradient function to calculate the derivative of the available data. This will be greater than...

8 days ago | 0

Answered

solving a system of ODEs in 3x3 matrix form

The easiest way would be to use the expm function. The expression changes slightly: A = rand(3); b = rand(3,1)...

solving a system of ODEs in 3x3 matrix form

The easiest way would be to use the expm function. The expression changes slightly: A = rand(3); b = rand(3,1)...

8 days ago | 0

Answered

Smoothing a curve and conserving the first and the last value of the curve

Probably the only way to do that is to use the 'SamplePoints' name-value pair, and smooth all but the beginning and end points —...

Smoothing a curve and conserving the first and the last value of the curve

Probably the only way to do that is to use the 'SamplePoints' name-value pair, and smooth all but the beginning and end points —...

8 days ago | 0

| accepted

Answered

10x10x15 matrix integration.

What are ‘X and Y axis’? I would use trapz and approach it as: AXY = A.*X.*Y.*A; Xint = trapz(AXY,1); ...

10x10x15 matrix integration.

What are ‘X and Y axis’? I would use trapz and approach it as: AXY = A.*X.*Y.*A; Xint = trapz(AXY,1); ...

8 days ago | 0

| accepted

Answered

How to plot two equal parts of axis y with unequal distances?

Set the tick locations (and displayed values if different) to specific values, and specify the tick format — x = zeros(1,5); ...

How to plot two equal parts of axis y with unequal distances?

Set the tick locations (and displayed values if different) to specific values, and specify the tick format — x = zeros(1,5); ...

8 days ago | 0

Answered

not enough input arguments Urgent Help

The function declaration is: function [V] = Tank_Volume(R, h, L, H) and the function call is: V(i)=Tank_Volume(h(i),R,H); ...

not enough input arguments Urgent Help

The function declaration is: function [V] = Tank_Volume(R, h, L, H) and the function call is: V(i)=Tank_Volume(h(i),R,H); ...

9 days ago | 0

Answered

Help with global optimization problem

The Golbal Optimization Toolbox functions (as much as I like them) may not be appropriate for this. See if the rica function (t...

Help with global optimization problem

The Golbal Optimization Toolbox functions (as much as I like them) may not be appropriate for this. See if the rica function (t...

9 days ago | 0

Answered

how can use randn function with any matrix and negative or not integers numbers ??

I am not certain what the desired result is. One possibility — x = [ 1.542 -2.551 0.657 6.337 -0.678 3.758 8.421...

how can use randn function with any matrix and negative or not integers numbers ??

I am not certain what the desired result is. One possibility — x = [ 1.542 -2.551 0.657 6.337 -0.678 3.758 8.421...

9 days ago | 0

Answered

nonlinear transformation between two sets of data points

The question is a bit ambiguous. If ‘fixed data’ is an input to the system, and ‘moving data’ is the output, the ssest function...

nonlinear transformation between two sets of data points

The question is a bit ambiguous. If ‘fixed data’ is an input to the system, and ‘moving data’ is the output, the ssest function...

9 days ago | 1

Answered

Format t-stat in square brackets

With respect to the square brackets — x = randn(1,5); fprintf('[%8.4f]\n',x) ‘Also, how do I export the results in excel f...

Format t-stat in square brackets

With respect to the square brackets — x = randn(1,5); fprintf('[%8.4f]\n',x) ‘Also, how do I export the results in excel f...

9 days ago | 0

Answered

Magnitude of a matrix

See if the vecnorm funcion (introduced in R2017b) will do what you want — x=randi(100,1000,3); X=vecnorm(x,2,2) .

Magnitude of a matrix

See if the vecnorm funcion (introduced in R2017b) will do what you want — x=randi(100,1000,3); X=vecnorm(x,2,2) .

9 days ago | 0

| accepted