Answered
Subscript indices must either be real positive integers or logicals.
Use the debugger. Type this at the MATLAB command prompt: dbstop if error Then run your code. When the error occurs, th...

8 years ago | 0

| accepted

Answered
Day_diff calculate the difference in days between two peoples birthdays in 2015?
_"... Make sure to check that the input values are of the correct types and they represent valid dates ..."_ Based on the wor...

8 years ago | 0

| accepted

Answered
I would like to use forloop for Matrix rearrange..
Either this: x = your 1x500 variable result = reshape(x,100,5).'; or result = reshape(x,5,100); Depending on ...

8 years ago | 0

| accepted

Answered
Solving an Equation 5th degree
5th order polynomials cannot be solved symbolically in general. E.g., see this: <https://en.wikipedia.org/wiki/Algebraic_solu...

8 years ago | 0

Answered
Wrong result in elipse equation
See this: <https://www.mathworks.com/matlabcentral/answers/57444-faq-why-is-0-3-0-2-0-1-not-equal-to-zero>

8 years ago | 0

| accepted

Answered
Is there a library for tracking the moon?
You could try these FEX submissions to get moon position: <https://www.mathworks.com/matlabcentral/fileexchange/56041-moon-po...

8 years ago | 0

Answered
Subscript assignment dimension mismatch when calling function
Type the following at the MATLAB prompt dbstop if error Then run your code. When the error occurs, the code will pause a...

8 years ago | 1

| accepted

Answered
Multiple results for iteratively multiplying a matrix with a vector quickly
Note that as the power value gets higher, the numerical stability of successive matrix multiplies will degrade and you will not ...

8 years ago | 0

Answered
Finding x such that 1 is eigenvalue
>> syms x >> det([1 2 3;3 x 4; 1 2 5]-eye(3)) ans = 5 - 3*x >> solve(ans) ans = 5/3 >> A = [1 2 3;3 5/3...

8 years ago | 0

Answered
Missing symbol 'mxArrayClassIDName' in 'D:\matlab/bin/win64\libmx.dll' error?
mxIsA and mxArrayClassIDName used to be part of the C API library interface (they appeared as undecorated names). In R2014a thes...

8 years ago | 0

Answered
In ODE solver how to use the time step of each iteration within the differential equation?
Based on your description, I would conclude that the deltat in the equation is simply the total amount of time that the mass flo...

8 years ago | 0

Answered
Need help on assigning output arguments in C language
Defining functions inside of functions is an extension to the language. In your posted code, that means the functions compile OK...

8 years ago | 0

| accepted

Answered
How to plot 2nd order ode
Follow the 2nd Order van der Pol ODE example in the ode45 doc: <https://www.mathworks.com/help/matlab/ref/ode45.html?searchHi...

8 years ago | 0

Answered
solving system of equations
1) Look at the examples here: <https://www.mathworks.com/help/matlab/ref/ode45.html?searchHighlight=ode45&s_tid=doc_srchtitle...

8 years ago | 0

| accepted

Answered
Matlab 2018a/Visual Studio 2017 linker failure, works in Matlab 2017b
One possible cause: If you compiled and ran the mex routine in R2017b, it could be that R2017b still has the stel.mexw64 file o...

8 years ago | 0

Answered
How can i go from L1 to a low moon orbit?
E.g., the ODE solvers can use events: <https://www.mathworks.com/help/matlab/math/ode-event-location.html>

8 years ago | 0

Answered
Creating C++ MEX Functions
Both VS Express and MinGW have C++ compilers. <https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-...

8 years ago | 0

Answered
replace the 2nd and 3rd elements without the use of find
Hints: 1) Create a new variable to store a(b) <-- Assuming b is a logical vector here! 2) Use c to index into this variab...

8 years ago | 0

Answered
What is wrong with my script?
Should this strcmp(alldata(k,3), 'SA{j}') be this strcmp(alldata(k,3), SA{j}) And should this strcmp(alldat...

8 years ago | 1

| accepted

Answered
Trying to do simple Monte Carlo simulation
Based on the wording of the assignment: To generate a normal distributed sample from the "5 +- .2 in": r = randn*(0.2/3)...

8 years ago | 1

| accepted

Answered
Matlab Calculates mod(2^1000,10^23) wrong
To expand on what Rik has posted ... IEEE double precision numbers only have about 16-17 equivalent decimal digits of precisi...

8 years ago | 0

Answered
How to correct this error?"Subscripted assignment dimension mismatch."
ub(i,1) is a scalar element, but ones(n,1) is a vector if n>1. You can't assign a vector to a scalar element.

8 years ago | 0

| accepted

Answered
Direct cell {} indexing of class method output
Spot checking: Works in R2009a 32-bit and R2018a 64-bit, so I would presume it has always worked although I have not tested ever...

8 years ago | 1

| accepted

Answered
Access element of ND array specified by another array?
doc sub2ind

8 years ago | 0

Answered
ODE45 for Second Order
Based on your description, I would have expected something more like this for the derivative: R = 2.5e-3; f = @(t,y) [y(...

8 years ago | 1

Answered
XOR between two 3d arrays: array1>=250 xor array2>=170
You almost had the syntax correct. E.g., sum(xor(myarray1>=10.5,myarray2>=50),3)

8 years ago | 0

| accepted

Answered
Calculating all combinations of vector-element multiplication
I don't know how to avoid a loop of some sort for an arbitrary number of variables, even if it is hidden in the background. E.g....

8 years ago | 0

| accepted

Answered
making an array with element values equal to column position
result = repmat(1:N,M,1);

8 years ago | 0

Answered
How to assign values in an identity matrix?
For this specific question, simple indexed assignment: I(1:2,end) = [2;4]; But what is your actual problem?

8 years ago | 0

| accepted

Answered
Precision in writing large numbers to file
See the 'precision' argument to dlmwrite.

8 years ago | 0

| accepted

Load more