Answered

Incorrect Intersection Output of Two Lines

The main difficulty here is comparing Klaus and Hans heights at simultaneous times. Note that the elements of xh and xk are not ...

Incorrect Intersection Output of Two Lines

The main difficulty here is comparing Klaus and Hans heights at simultaneous times. Note that the elements of xh and xk are not ...

alrededor de 22 horas ago | 0

Answered

Only getting zero as my output for ode45

The "problem" is that x0 = 0 is an equilibrium point of your system dx/dt = 0 when x = 0. So if you start the system at x0 = 0 ...

Only getting zero as my output for ode45

The "problem" is that x0 = 0 is an equilibrium point of your system dx/dt = 0 when x = 0. So if you start the system at x0 = 0 ...

alrededor de 23 horas ago | 0

Answered

Defining ODE function as function file

Looking briefly at your function definitions, it seems that maybe you are misunderstanding what this function is to compute. It ...

Defining ODE function as function file

Looking briefly at your function definitions, it seems that maybe you are misunderstanding what this function is to compute. It ...

alrededor de 23 horas ago | 0

| accepted

Answered

Transfer function to low or high pass

One way would be to make a Bode plot of the frequency response and determine does it gain go to zero at high frequencies or low ...

Transfer function to low or high pass

One way would be to make a Bode plot of the frequency response and determine does it gain go to zero at high frequencies or low ...

1 día ago | 0

Answered

How do I get a loop to calculate for each value of a formula, not just the last n of the input(N)?

You must provide an array to hold your output force. You keep overwriting it with each loop iteration So, depending upon what y...

How do I get a loop to calculate for each value of a formula, not just the last n of the input(N)?

You must provide an array to hold your output force. You keep overwriting it with each loop iteration So, depending upon what y...

1 día ago | 0

| accepted

Answered

How do I vectorize a nested for loop with different sized steps?

I think you may be able to utilize the filter2 function for this purpose. For example A = [1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 ...

How do I vectorize a nested for loop with different sized steps?

I think you may be able to utilize the filter2 function for this purpose. For example A = [1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 ...

4 días ago | 0

Answered

Trying to find a minimum value

You may have some additional problems but one is that you reset wb to zero with every loop iteration, first line in your loop is...

Trying to find a minimum value

You may have some additional problems but one is that you reset wb to zero with every loop iteration, first line in your loop is...

4 días ago | 0

| accepted

Answered

Plotting sequences over intervals

You could do it like this n = -10:10 x = zeros(length(n),1) % preallocate array of zeros to hold result for k = 1:length(n) ...

Plotting sequences over intervals

You could do it like this n = -10:10 x = zeros(length(n),1) % preallocate array of zeros to hold result for k = 1:length(n) ...

5 días ago | 1

| accepted

Answered

Index in position 2 exceeds array bounds (must not exceed 1). Error in dlmread (line 159) result= result(:,1:ncols);

You may have other problems too, but I noticed that since i does not change inside of your loop, you always read from the same s...

Index in position 2 exceeds array bounds (must not exceed 1). Error in dlmread (line 159) result= result(:,1:ncols);

You may have other problems too, but I noticed that since i does not change inside of your loop, you always read from the same s...

5 días ago | 0

Answered

optimising variables that are dependent on other variables

If you have the optimization toolbox then you can use fmincon to solve this type of problem. https://www.mathworks.com/help/opti...

optimising variables that are dependent on other variables

If you have the optimization toolbox then you can use fmincon to solve this type of problem. https://www.mathworks.com/help/opti...

5 días ago | 0

| accepted

Answered

Why is my plot not showing?

You need to use ./ Other wise you end up with just one value for f,g, and h x=linspace(-2,2,100); f=(3*x)./(9*x.^2+1) % ./ g=...

Why is my plot not showing?

You need to use ./ Other wise you end up with just one value for f,g, and h x=linspace(-2,2,100); f=(3*x)./(9*x.^2+1) % ./ g=...

6 días ago | 1

| accepted

Answered

Plotting for specific values

plot(node,U(:,t==0.25),node,U(t==0.5)) % and so on

Plotting for specific values

plot(node,U(:,t==0.25),node,U(t==0.5)) % and so on

6 días ago | 0

| accepted

Answered

Problem using polyfit with NaN data

To avoid having NaN in polyfit I would use iFit = isfinite(Strain) c = polyfit(Strain(iFit),Load(iFit)) % ok to have NaN w...

Problem using polyfit with NaN data

To avoid having NaN in polyfit I would use iFit = isfinite(Strain) c = polyfit(Strain(iFit),Load(iFit)) % ok to have NaN w...

6 días ago | 0

| accepted

Answered

Solve as Optimization Problem in Matlab

I think you can use the MILP mixed integer linear programming functionality if you have the optimization toolbox https://www.ma...

Solve as Optimization Problem in Matlab

I think you can use the MILP mixed integer linear programming functionality if you have the optimization toolbox https://www.ma...

6 días ago | 0

Answered

Plot / Solve system for nontrivial answer. dot operator issue?

I don't have the symbolic toolbox, but you can also solve this type of problem using fzero You need to write a little function ...

Plot / Solve system for nontrivial answer. dot operator issue?

I don't have the symbolic toolbox, but you can also solve this type of problem using fzero You need to write a little function ...

6 días ago | 1

Answered

Using an external script/function in simulink "matlab function block"

Will the 1-D interpolation block do what you need? https://www.mathworks.com/help/simulink/slref/1dlookuptable.html

Using an external script/function in simulink "matlab function block"

Will the 1-D interpolation block do what you need? https://www.mathworks.com/help/simulink/slref/1dlookuptable.html

8 días ago | 0

| accepted

Answered

My code taking too much time

You can operate on the entire vector using for example a(a<1) = randn So you could make a loop something like while any(a<1) ...

My code taking too much time

You can operate on the entire vector using for example a(a<1) = randn So you could make a loop something like while any(a<1) ...

8 días ago | 0

| accepted

Answered

How to perform xor operation on an three input binary bits.

The MATLAB function xor takes two input arguments and and provides and xor between the elements of each argument. So for exampl...

How to perform xor operation on an three input binary bits.

The MATLAB function xor takes two input arguments and and provides and xor between the elements of each argument. So for exampl...

8 días ago | 1

Answered

Automatically take folder directories of one level up

You can specify the full path to the directories you want to open rather than changing the directory that MATLAB is running in. ...

Automatically take folder directories of one level up

You can specify the full path to the directories you want to open rather than changing the directory that MATLAB is running in. ...

11 días ago | 0

Answered

Multiply/divided two tables

% suppose you have a table T1 and T2 you could do something like A = [T1.myColumnName1 T1.myColumnName2] B = [T2.myColumnName...

Multiply/divided two tables

% suppose you have a table T1 and T2 you could do something like A = [T1.myColumnName1 T1.myColumnName2] B = [T2.myColumnName...

11 días ago | 0

Answered

How to unit test several different functions that take the same input arguments efficiently?

Here are a couple of possibilities You can pass function handles, and then make the function you are testing be one of the argu...

How to unit test several different functions that take the same input arguments efficiently?

Here are a couple of possibilities You can pass function handles, and then make the function you are testing be one of the argu...

11 días ago | 0

Answered

For loop data extraction

You overwrite your t and soln values with each loop iteration. If you want to save those to use them later you need to put them ...

For loop data extraction

You overwrite your t and soln values with each loop iteration. If you want to save those to use them later you need to put them ...

12 días ago | 1

Answered

How to read a specefic column of several xls file and create a matrix

The readmatrix function can be used to read in the.Use the range option to specify the column you want from each .xls file. Type...

How to read a specefic column of several xls file and create a matrix

The readmatrix function can be used to read in the.Use the range option to specify the column you want from each .xls file. Type...

12 días ago | 1

| accepted

Answered

Why do I keep getting this error message? Error using ./ Matrix dimensions must agree.

I can run your code without getting any error messages. Can you please be more specific about how to reproduce the error. Also w...

Why do I keep getting this error message? Error using ./ Matrix dimensions must agree.

I can run your code without getting any error messages. Can you please be more specific about how to reproduce the error. Also w...

12 días ago | 0

Answered

How to format this Loop?

In your code above x and y are the same they are both assigned to Data(d,:) do you mean to have? x = Data(d,:); y ...

How to format this Loop?

In your code above x and y are the same they are both assigned to Data(d,:) do you mean to have? x = Data(d,:); y ...

13 días ago | 0

| accepted

Answered

Phase Angle in Vortex-Induced Vibrations

If you have phase angle values theta and velocity values v you can just plot plot(v,theta) If you are asking how do you calcu...

Phase Angle in Vortex-Induced Vibrations

If you have phase angle values theta and velocity values v you can just plot plot(v,theta) If you are asking how do you calcu...

13 días ago | 0

Answered

Polyfit returns the wrong correlation coeffcient when I try do a linear regression

I don't think you are plotting your fitted y values For example where you have fFMA = polyval(pFMA,subwFMA(:)); ...

Polyfit returns the wrong correlation coeffcient when I try do a linear regression

I don't think you are plotting your fitted y values For example where you have fFMA = polyval(pFMA,subwFMA(:)); ...

13 días ago | 0

| accepted

Answered

How to make matlab show line of error in appdesigner

I see in the documentation that "stack is an N-by-1 struct array, where N represents the depth of the call stack" Is it possibl...

How to make matlab show line of error in appdesigner

I see in the documentation that "stack is an N-by-1 struct array, where N represents the depth of the call stack" Is it possibl...

13 días ago | 0

| accepted

Answered

How to find unknown parameters from experimental data fitted to an equation?

If you have the Optimization Toolbox you can use the function lsqcurvefit for solving this problem. Type doc lsqcurvefit on your...

How to find unknown parameters from experimental data fitted to an equation?

If you have the Optimization Toolbox you can use the function lsqcurvefit for solving this problem. Type doc lsqcurvefit on your...

13 días ago | 0

Answered

Real and Imaginary element Separation from square matrix and stacking into a vector

D = diag(A) L = triu(A,1) U = tril(A,-1) [D; real(U(:)); real(L(:))] is close but you still have zero elements in L and U to...

Real and Imaginary element Separation from square matrix and stacking into a vector

D = diag(A) L = triu(A,1) U = tril(A,-1) [D; real(U(:)); real(L(:))] is close but you still have zero elements in L and U to...

14 días ago | 1

| accepted