Answered

How do I efficiently iterate over subvectors of a given vector?

https://www.mathworks.com/help/matlab/ref/movsum.html

How do I efficiently iterate over subvectors of a given vector?

https://www.mathworks.com/help/matlab/ref/movsum.html

9 hours ago | 1

| accepted

Answered

How to read all .csv files from a folder in an order?

https://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort

How to read all .csv files from a folder in an order?

https://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort

9 hours ago | 1

Answered

How to correlate spectral coeficient

Calculation of spectral coefficients is almost always done over a particular number of samples (representing a pre-determined am...

How to correlate spectral coeficient

Calculation of spectral coefficients is almost always done over a particular number of samples (representing a pre-determined am...

18 hours ago | 0

Answered

Smooth function not working

which smooth You will find that you are using some other smooth function, not toolbox/curvefit/curvefit/smooth.m . In the offic...

Smooth function not working

which smooth You will find that you are using some other smooth function, not toolbox/curvefit/curvefit/smooth.m . In the offic...

18 hours ago | 0

Answered

How to create combinations of rows in an array?

result = permute(reshape( data(perms(1:size(data,1)).',:).', size(data,2), size(data,1), []), [2 1 3]);

How to create combinations of rows in an array?

result = permute(reshape( data(perms(1:size(data,1)).',:).', size(data,2), size(data,1), []), [2 1 3]);

18 hours ago | 0

| accepted

Answered

Introducing new rows (or columns) into an existing matrix with interpolated values to fill technically non-existent gaps.

Create a timetable() object and use retime() https://www.mathworks.com/help/releases/R2017a/matlab/ref/retime.html

Introducing new rows (or columns) into an existing matrix with interpolated values to fill technically non-existent gaps.

Create a timetable() object and use retime() https://www.mathworks.com/help/releases/R2017a/matlab/ref/retime.html

20 hours ago | 0

Answered

syntax errors symbolic to logical

You missed the point that requires that the gradient of f be evaluated at x. You are taking the symbolic gradient of f into gf,...

syntax errors symbolic to logical

You missed the point that requires that the gradient of f be evaluated at x. You are taking the symbolic gradient of f into gf,...

20 hours ago | 0

| accepted

Answered

How can i create constant in a .m archive and use it for the creation of new objects?

https://www.mathworks.com/help/matlab/matlab_oop/properties-with-constant-values.html and note https://www.mathworks.com/help/ma...

How can i create constant in a .m archive and use it for the creation of new objects?

https://www.mathworks.com/help/matlab/matlab_oop/properties-with-constant-values.html and note https://www.mathworks.com/help/ma...

21 hours ago | 1

| accepted

Answered

whats problem in my code for solve newton Rhapson method for equation 4-x^2-y^2 1-exp(x)-y

Suppose we could find some way to make your assignments to f(x,y) and g(x,y) work out. Then what would you do with the results? ...

whats problem in my code for solve newton Rhapson method for equation 4-x^2-y^2 1-exp(x)-y

Suppose we could find some way to make your assignments to f(x,y) and g(x,y) work out. Then what would you do with the results? ...

22 hours ago | 0

Answered

How do I label pcolor y and x axes please

img = sort(randi([0 255], 240, 320, 'uint8')); subplot(1,2,1); imagesc(img); colormap(hot); xlabel('x'); ylabel('y'); subplot(...

How do I label pcolor y and x axes please

img = sort(randi([0 255], 240, 320, 'uint8')); subplot(1,2,1); imagesc(img); colormap(hot); xlabel('x'); ylabel('y'); subplot(...

22 hours ago | 0

Answered

How to perform these discrete signals?

is the Dirac delta function. dirac(x) is zero whenever x is not zero, and has a non-zero value when x is 0. Call that value D. ...

How to perform these discrete signals?

is the Dirac delta function. dirac(x) is zero whenever x is not zero, and has a non-zero value when x is 0. Call that value D. ...

22 hours ago | 0

Answered

How to set bounds on fmincon manually

x0(1,:) = (x1_bounds(1,2)-x1_bounds(1,1)).*rand(1,SearchPoints) + x1_bounds(1,1); x0(2,:) = (x2_bounds(1,2)-x2_bounds(1...

How to set bounds on fmincon manually

x0(1,:) = (x1_bounds(1,2)-x1_bounds(1,1)).*rand(1,SearchPoints) + x1_bounds(1,1); x0(2,:) = (x2_bounds(1,2)-x2_bounds(1...

23 hours ago | 0

| accepted

Answered

Fimplicit not plotting properly

a=2; h=0/2; b=0; g=3/2; f=1/2; c=7; fun1=@(x,y) a.*x.^2+2*h.*x.*y+b*y.^2+2*g.*x+2*f.*y+c; fimplicit(fun1, [-10 10 -10 10]) Lo...

Fimplicit not plotting properly

a=2; h=0/2; b=0; g=3/2; f=1/2; c=7; fun1=@(x,y) a.*x.^2+2*h.*x.*y+b*y.^2+2*g.*x+2*f.*y+c; fimplicit(fun1, [-10 10 -10 10]) Lo...

1 day ago | 1

Answered

How to do a rem while loop?

while true h = input('Enter the desired grid spacing: '); if isnumeric(h) && isscalar(h) && h > 0 && rem(h,1) == 0; br...

How to do a rem while loop?

while true h = input('Enter the desired grid spacing: '); if isnumeric(h) && isscalar(h) && h > 0 && rem(h,1) == 0; br...

1 day ago | 0

Answered

Laplace transform not found.

The wk^3*exp(x*tau) is getting integrated to include a /tau^4 term -- the general pattern wk^n*exp(...*tau) integrates to someth...

Laplace transform not found.

The wk^3*exp(x*tau) is getting integrated to include a /tau^4 term -- the general pattern wk^n*exp(...*tau) integrates to someth...

1 day ago | 0

Answered

matlab error ode45

x0=[0,10,45]; %initial condtion tspan=[0,30];% time span u=10; odefun = @(t,y)reshape(rolling(t,y,u), [], 1); [t,x]=ode45(...

matlab error ode45

x0=[0,10,45]; %initial condtion tspan=[0,30];% time span u=10; odefun = @(t,y)reshape(rolling(t,y,u), [], 1); [t,x]=ode45(...

1 day ago | 0

Answered

vpasolve -> Empty sym: 0-by-1

I was seeing some oddities when I solved, so I tried solving two different ways: R=8.3144; T=298.15; F=96487; eps0= 8.854*10...

vpasolve -> Empty sym: 0-by-1

I was seeing some oddities when I solved, so I tried solving two different ways: R=8.3144; T=298.15; F=96487; eps0= 8.854*10...

1 day ago | 0

| accepted

Answered

What does [3, Inf] represents?

In addition to what the others say: that kind of variable would tend to be used as the size parameter for reading data, such as ...

What does [3, Inf] represents?

In addition to what the others say: that kind of variable would tend to be used as the size parameter for reading data, such as ...

2 days ago | 1

| accepted

Answered

For loop stores all zeros then the actual values of last iteration

Your statement finalsm = zeros(height(x),1); % 'height(x)' bc array changes size each iteration is throwing away all previ...

For loop stores all zeros then the actual values of last iteration

Your statement finalsm = zeros(height(x),1); % 'height(x)' bc array changes size each iteration is throwing away all previ...

2 days ago | 0

| accepted

Answered

convert binary string into hex

lookup = containers.Map(cellstr(dec2bin(0:15,4)),cellstr(dec2hex(0:15))); binary_string = '0101010011101010'; output = cel...

convert binary string into hex

lookup = containers.Map(cellstr(dec2bin(0:15,4)),cellstr(dec2hex(0:15))); binary_string = '0101010011101010'; output = cel...

2 days ago | 0

| accepted

Answered

How to read text file backwards?

You can fopen() the file for reading and fseek() to a particular offset relative to the end of file. You will not be able to fs...

How to read text file backwards?

You can fopen() the file for reading and fseek() to a particular offset relative to the end of file. You will not be able to fs...

2 days ago | 0

Answered

ERROR Subscript indices must either be real positive integers or logicals.

for j=1:j_max+1 x=v((j-1:j+N0-2)*dt); j starts at 1. j-1 starts at 0. 0 multiplied by anything is 0. Therefore your first ind...

ERROR Subscript indices must either be real positive integers or logicals.

for j=1:j_max+1 x=v((j-1:j+N0-2)*dt); j starts at 1. j-1 starts at 0. 0 multiplied by anything is 0. Therefore your first ind...

2 days ago | 0

Answered

Why do the lines not plot to completion

solution2=ode45(vector2, [0 1], [.39 0]); factor2=((1+b_2)/(F))*(solution2.y(2,:)); % Effective Factor First Order 1 so fact...

Why do the lines not plot to completion

solution2=ode45(vector2, [0 1], [.39 0]); factor2=((1+b_2)/(F))*(solution2.y(2,:)); % Effective Factor First Order 1 so fact...

2 days ago | 1

Answered

How Can I Pull A Specific Variable From The Determinant of Matrix?

You have no realistic chance of calculating one variable in terms of the other symbolically. Your function involves the first tw...

How Can I Pull A Specific Variable From The Determinant of Matrix?

You have no realistic chance of calculating one variable in terms of the other symbolically. Your function involves the first tw...

2 days ago | 0

Answered

How to combine the using of meshgrid and surface?

x = linspace(0,.1); y = linspace(.3, .4); [X, Y] = meshgrid(x, y); Z = X.^2 - 5.*Y.^3 + sin(5*2*pi*X); surf(X, Y, Z, 'edgeco...

How to combine the using of meshgrid and surface?

x = linspace(0,.1); y = linspace(.3, .4); [X, Y] = meshgrid(x, y); Z = X.^2 - 5.*Y.^3 + sin(5*2*pi*X); surf(X, Y, Z, 'edgeco...

3 days ago | 0

| accepted

Answered

Get rid of unnecessary space in output of full(A)

disp(num2str(full(A))) You can add a format specifier to num2str() to be more specific about widths.

Get rid of unnecessary space in output of full(A)

disp(num2str(full(A))) You can add a format specifier to num2str() to be more specific about widths.

3 days ago | 1

| accepted

Answered

Merge data by date

Convert your data to a timetable() object, and use retime() to consolidate the information.

Merge data by date

Convert your data to a timetable() object, and use retime() to consolidate the information.

3 days ago | 0

| accepted

Answered

Can I pcolor base on wavelength, any colormap can do so?

When you pcolor(X,Y,I) then the I data will be used to decide which color information is used. By default, the numerically lowes...

Can I pcolor base on wavelength, any colormap can do so?

When you pcolor(X,Y,I) then the I data will be used to decide which color information is used. By default, the numerically lowes...

3 days ago | 0

Answered

How to: write .xls into a dynamic folder name ?

folder = [Answer{1},' ',Answer{2},' ',num2str(Answer{3})]; if ~exist(folder, 'dir'); mkdir(folder); end filename = 'patient_...

How to: write .xls into a dynamic folder name ?

folder = [Answer{1},' ',Answer{2},' ',num2str(Answer{3})]; if ~exist(folder, 'dir'); mkdir(folder); end filename = 'patient_...

3 days ago | 0

| accepted

Answered

How to run continuously

current_state = 0; writeDigitalPin(a,'D2',current_state); while true if readVoltage(a, 'A1') >= 2 if current_s...

How to run continuously

current_state = 0; writeDigitalPin(a,'D2',current_state); while true if readVoltage(a, 'A1') >= 2 if current_s...

3 days ago | 0

| accepted