답변 있음
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...

7달 전 | 0

답변 있음
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...

7달 전 | 1

| 수락됨

답변 있음
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=...

7달 전 | 1

| 수락됨

답변 있음
Plotting for specific values
plot(node,U(:,t==0.25),node,U(t==0.5)) % and so on

7달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 0

답변 있음
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 ...

7달 전 | 1

답변 있음
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

7달 전 | 0

| 수락됨

답변 있음
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) ...

7달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 1

답변 있음
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. ...

7달 전 | 0

답변 있음
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...

7달 전 | 0

답변 있음
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...

7달 전 | 0

답변 있음
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 ...

7달 전 | 1

답변 있음
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...

7달 전 | 1

| 수락됨

답변 있음
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...

7달 전 | 0

답변 있음
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 ...

7달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 0

답변 있음
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(:)); ...

7달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 1

| 수락됨

답변 있음
Why does the MATLAB plot show up with no function on it?
Your plot limits are outside of the range of the data. Also you don't have enough (or any data points) in the range of x that ...

7달 전 | 0

답변 있음
Continuous to Discrete time signal
You should just evaluate and save your values x_t once Then to get your discrete samples (assuming the discrete sample interva...

7달 전 | 0

답변 있음
How do i make plot like this?
You must first make a matlab function or script to evaluate your y(x) and then plot your values So something like % define con...

7달 전 | 0

| 수락됨

답변 있음
how to compare previous and next values in MATLAB?
You need to create a new variable, call it for example prevB. After each loop set prevB = B when you do your comparison compar...

7달 전 | 0

답변 있음
How do I create an array with the greatest values from two arrays?
C = max(A,B)

7달 전 | 0

| 수락됨

답변 있음
Extract columns from matrix based on a vectors values
I think this should do it for you: C = A(:,B)

7달 전 | 0

| 수락됨

답변 있음
create csv files by extracting data from a starting csv file
Without knowing all of the details of what is in your files it is hard to give a specific answer. However for general advice I w...

8달 전 | 0

답변 있음
Minimalizing mean absolute error through optimisation?
You should be able to frame this as a linear programming problem which can be solved using MATLAB's linprog function.

8달 전 | 0