Answered

Calculate area under curve of multiple peaks

Not the most robust code, but it will work for what you have. You will need to check your findpeaks function to make sure it's o...

Calculate area under curve of multiple peaks

Not the most robust code, but it will work for what you have. You will need to check your findpeaks function to make sure it's o...

1 year ago | 0

Answered

how to solve a system of non linear-equations

I ran the code below and some different versions of vpasolve, but I still got the same answer: no solution. So I have to think t...

how to solve a system of non linear-equations

I ran the code below and some different versions of vpasolve, but I still got the same answer: no solution. So I have to think t...

1 year ago | 0

Answered

Issue with Switch state in AppDesigner

function VioletSwitchValueChanged(app, event) value = app.VioletSwitch.Value if strcmpi(value,'On') ==...

Issue with Switch state in AppDesigner

function VioletSwitchValueChanged(app, event) value = app.VioletSwitch.Value if strcmpi(value,'On') ==...

1 year ago | 2

Answered

definite integral not giving exact answer

I don't know what the issue is. I did this and got 8*r/5. The answer seems to be correct. syms r sym(-r*(cos(175787564848171/7...

definite integral not giving exact answer

I don't know what the issue is. I did this and got 8*r/5. The answer seems to be correct. syms r sym(-r*(cos(175787564848171/7...

1 year ago | 0

Answered

Trying to create two arrays called z and y

First I would rename the variable i as ii so it’s not confused with the more general use of i = sqrt(-1). To save the variable, ...

Trying to create two arrays called z and y

First I would rename the variable i as ii so it’s not confused with the more general use of i = sqrt(-1). To save the variable, ...

1 year ago | 0

| accepted

Answered

How can I automatically select two points in a plot?

Select them as in producing data tips? If that's the case, then see the code below. If not, then please explain what you'd like ...

How can I automatically select two points in a plot?

Select them as in producing data tips? If that's the case, then see the code below. If not, then please explain what you'd like ...

1 year ago | 0

Answered

How to use 'CancelRequested' property for a progress bar?

fig = uifigure; dlg = uiprogressdlg(fig,'Title','Wait',... 'Message','Starting','Cancelable','on','CancelText','Stop this'...

How to use 'CancelRequested' property for a progress bar?

fig = uifigure; dlg = uiprogressdlg(fig,'Title','Wait',... 'Message','Starting','Cancelable','on','CancelText','Stop this'...

1 year ago | 1

| accepted

Answered

How to use 'CancelRequested' property for a progress bar?

progressbar = waitbar(0,'Determining optimum slope','CreateCancelBtn','setappdata(gcbf,''Cancel'',1)'); wholeRandNum = 215; fo...

How to use 'CancelRequested' property for a progress bar?

progressbar = waitbar(0,'Determining optimum slope','CreateCancelBtn','setappdata(gcbf,''Cancel'',1)'); wholeRandNum = 215; fo...

1 year ago | 0

Answered

forbid the switch of tab group in app designer while running a calculation

It doesn't look as if I can attach my mlapp file so I'll paste the relevant code here and let you put it together. When you hit ...

forbid the switch of tab group in app designer while running a calculation

It doesn't look as if I can attach my mlapp file so I'll paste the relevant code here and let you put it together. When you hit ...

1 year ago | 1

Answered

How do I return callback value from GUI to workspace

Let’s say the variable you want to send to the workspace is called savethis in your GUI, and let’s say you want the variable in ...

How do I return callback value from GUI to workspace

Let’s say the variable you want to send to the workspace is called savethis in your GUI, and let’s say you want the variable in ...

1 year ago | 0

| accepted

Answered

Problem of measure unit conversion

https://www.mathworks.com/matlabcentral/fileexchange/4093-units-m?focused=5053365&tab=function This is what I use. You can ad...

Problem of measure unit conversion

https://www.mathworks.com/matlabcentral/fileexchange/4093-units-m?focused=5053365&tab=function This is what I use. You can ad...

1 year ago | 0

| accepted

Answered

How to delete a matrix using for loop and if condition?

clear clc MA1 = ones(3); MA2 = MA1*2; MA3 = MA1*3; MA4 = MA1*4; MA5 = MA1*5; MB...

How to delete a matrix using for loop and if condition?

clear clc MA1 = ones(3); MA2 = MA1*2; MA3 = MA1*3; MA4 = MA1*4; MA5 = MA1*5; MB...

1 year ago | 0

Answered

App Designer - ListBox Tooltip for too long entries not there any more in 2019b

How did you originally get the tooltip to specify only the line you're hovering on in 2018a? The only way I know is to use mouse...

App Designer - ListBox Tooltip for too long entries not there any more in 2019b

How did you originally get the tooltip to specify only the line you're hovering on in 2018a? The only way I know is to use mouse...

1 year ago | 0

Answered

Solving an equation and using the answer for other equations

w = 8.37; L = 30; h = 6.5; theta = 12; N = L/2 + h/tand(theta); syms m eqn = m^2/(2*w) + m*(5*N/3 - L/3) + w*L^2/8; M = ...

Solving an equation and using the answer for other equations

w = 8.37; L = 30; h = 6.5; theta = 12; N = L/2 + h/tand(theta); syms m eqn = m^2/(2*w) + m*(5*N/3 - L/3) + w*L^2/8; M = ...

1 year ago | 1

| accepted

Answered

Solve the following system of non-linear equations

syms x y z eqn1 = x*y*z - x^2 +y^2 - 1.34; eqn2 = x*y - z^2 - 0.09; eqn3 = exp(x) - exp(y) + z - 0.41; sol = vpasolve(eqn1,e...

Solve the following system of non-linear equations

syms x y z eqn1 = x*y*z - x^2 +y^2 - 1.34; eqn2 = x*y - z^2 - 0.09; eqn3 = exp(x) - exp(y) + z - 0.41; sol = vpasolve(eqn1,e...

1 year ago | 0

Answered

How to find the intersection points of a plot that contains multiple straight lines?

This currently only works for the three lines. There's a way to do it for multiple "spawns" but I didn't have time to look at th...

How to find the intersection points of a plot that contains multiple straight lines?

This currently only works for the three lines. There's a way to do it for multiple "spawns" but I didn't have time to look at th...

1 year ago | 0

Answered

Error running for loop

if true syms P l=100; a=50; b=20; h0=50; E=200; h1=50;%n=1.5; for n=1:0.02:4 I0=b*h0^3/12; I1=b*h1^3/12; L0=sqrt(P/(...

Error running for loop

if true syms P l=100; a=50; b=20; h0=50; E=200; h1=50;%n=1.5; for n=1:0.02:4 I0=b*h0^3/12; I1=b*h1^3/12; L0=sqrt(P/(...

1 year ago | 0

| accepted

Answered

Plotting data from three dimensional array

It’s because your y array is 1x21 and your x is 1x100. Your dimensions don’t match. Make sure your y variable is correct.

Plotting data from three dimensional array

It’s because your y array is 1x21 and your x is 1x100. Your dimensions don’t match. Make sure your y variable is correct.

1 year ago | 1

| accepted

Answered

Extracting data from array

%c is our array of data. column 1 is whether there was a crash, and column 2 is the reason c = {'Crash';'Crash';'Nothing';'Cras...

Extracting data from array

%c is our array of data. column 1 is whether there was a crash, and column 2 is the reason c = {'Crash';'Crash';'Nothing';'Cras...

1 year ago | 0

| accepted

Answered

Calculating area under the curve for glucose responses over time

Looks like your trapezoidal integration is correct. I checked your Excel formula and didn't find anything wrong, and I did the f...

Calculating area under the curve for glucose responses over time

Looks like your trapezoidal integration is correct. I checked your Excel formula and didn't find anything wrong, and I did the f...

1 year ago | 0

Answered

Interpolation between two surfaces with same grid

Try using the interp3 function.

Interpolation between two surfaces with same grid

Try using the interp3 function.

1 year ago | 0

Answered

Hi, When you create a plot and hover over a data point WITHOUT pressing anything a datatip is displayed. How do I change the callback to display something else or do something else?

N = 30; yy = ceil(rand(N,1)*50); xx = 1:N; str = cell(1,N); for pp = 1:N str{pp} = sprintf('Sample %d',pp); end reer ...

Hi, When you create a plot and hover over a data point WITHOUT pressing anything a datatip is displayed. How do I change the callback to display something else or do something else?

N = 30; yy = ceil(rand(N,1)*50); xx = 1:N; str = cell(1,N); for pp = 1:N str{pp} = sprintf('Sample %d',pp); end reer ...

1 year ago | 1

Answered

App designer - how to make a simple button preselected so mouse cursor is not needed?

You'll start by going to the Design View tab and then looking at the Component Browser where all your components are listed. Fro...

App designer - how to make a simple button preselected so mouse cursor is not needed?

You'll start by going to the Design View tab and then looking at the Component Browser where all your components are listed. Fro...

1 year ago | 1

| accepted

Answered

Saving output values from a function into an array (to plot later)

options = optimset('PlotFcns',@optimplotfval); scarysum = 0; for k = 1:30 syms t term = ((-1).^(k-1))./k .* sin(k.*pi.*rho) ...

Saving output values from a function into an array (to plot later)

options = optimset('PlotFcns',@optimplotfval); scarysum = 0; for k = 1:30 syms t term = ((-1).^(k-1))./k .* sin(k.*pi.*rho) ...

1 year ago | 0

Answered

Reference to non-existent field 'D1t'.

PAR.Ac = (pi/4)*((PAR.D1t^2)-(PAR.D1h^2)); %Compressor area There's no information for your PAR.D1t and PAR.D1h. I guess these ...

Reference to non-existent field 'D1t'.

PAR.Ac = (pi/4)*((PAR.D1t^2)-(PAR.D1h^2)); %Compressor area There's no information for your PAR.D1t and PAR.D1h. I guess these ...

1 year ago | 1

| accepted

Answered

How to name row in uitable.

uit = uitable(uifigure,'Data',rand(10,3),'ColumnEditable',[false true true]) rows = size(uit.Data,1); ss = strcat('BS',string(...

How to name row in uitable.

uit = uitable(uifigure,'Data',rand(10,3),'ColumnEditable',[false true true]) rows = size(uit.Data,1); ss = strcat('BS',string(...

1 year ago | 0

Answered

How to show my output in regular time sequence at app designer?

t = 0.5; %time in seconds app.EditField1.Value = 4; %your value for the first edit field pause(t) app.EditField2.Value = 3; %...

How to show my output in regular time sequence at app designer?

t = 0.5; %time in seconds app.EditField1.Value = 4; %your value for the first edit field pause(t) app.EditField2.Value = 3; %...

1 year ago | 0