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

Answered
dcm2quat is returning invalid quaternions
ACB is not a valid direction cosine matrix. You can see that its determinant is not close to 1: >> ACB = [ 0.4970 0.8...

8 years ago | 0

| accepted

Answered
How can I run my first Mex function?
Some problems: 1) /* coppy array and set the output pointer to it */ plhs[0] = prhs[2]; The above line doe...

8 years ago | 3

| accepted

Answered
Am beginner here, can anyone tell me What is wrong with the code with while loop?
You never update the "a" vector inside the loop. It was built from the original values of x and y and never changes. To fix thi...

8 years ago | 0

| accepted

Answered
3D array permutation
According to the doc for contour(Z), _"... The x values correspond to the column indices of Z and the y values correspond to the...

8 years ago | 0

Answered
Index exceeds matrix dimensions error
You can get this error if numel(w)<6, so I would check that first.

8 years ago | 0

Load more