Risposto
What does it mean when you put Loop = 1; in a program
This is a "forever" loop. It executes until a break statement is encountered. E.g., the general construct is while( 1 ) % ...

quasi 6 anni fa | 0

Risposto
ASCII multiplication returns array of numbers
The characters are converted to double values (ASCII code numbers) and then multiplied. That is the way the * operator works fo...

quasi 6 anni fa | 0

Risposto
Mex function out plhs[0] is all zeros
There are three problems with your code. 1) Assigning the value of a pointer to another pointer does not attach the pointer to ...

quasi 6 anni fa | 1

| accettato

Risposto
Weird output and calling to another function
That's because you are returning m. I think you want to return z: function z = primefactors(m)

quasi 6 anni fa | 0

| accettato

Risposto
How to use Shuffle.c index mode for complex numbers
Note: Compiling mex code in R2018a or later with the '-R2017b' option will cause the mex routine to make deep copies of all comp...

quasi 6 anni fa | 0

Risposto
vector multiplication with its transpose
Variables and expressions in MATLAB need an operator between them ... there is no implied multiply. So this (y(t+1)-y(t))'W(y(t...

quasi 6 anni fa | 0

Risposto
Matrix dimensions must agree error
t and g look like they are vectors, so use element-wise operators (with the . dot) when dealing with equations involving them. E...

quasi 6 anni fa | 0

Risposto
Finding the if the complex numbers with the imaginary part not equal to zero (array)
The equality conditional operator in MATLAB is the double equals ==, so y = sp(imag(sp)==0)

quasi 6 anni fa | 0

Risposto
How do I split one column with 744 rows into 31 columns with 24 values.
A = your column vector result = reshape(A,24,31);

quasi 6 anni fa | 0

| accettato

Risposto
How do I rearrange these matrix values?
A = your matrix result = reshape(A,3,4)'

quasi 6 anni fa | 0

Risposto
Calllib error: Array must be numeric or logical or a pointer to one
This sounds very similar to the following post, where someone was trying to call a function that had a function pointer as one o...

quasi 6 anni fa | 0

Risposto
Matlab Coding for a spacecraft
Thanks for the image post. So, this is a standard orbital proximity operations relative motion question. The equations in your ...

quasi 6 anni fa | 0

| accettato

Risposto
Need help to translate Lat/long as signed 32bit integer to decimal degrees.
The LSB is probably telling you that the value of the Least Significant Bit of the integer value is 1.6764e-07. Since MATLAB al...

quasi 6 anni fa | 3

| accettato

Risposto
Determine Matrix Operation Memory Usage
This is going to depend on the specific operations you are doing, and might also depend on whether any of the variables involved...

quasi 6 anni fa | 0

Risposto
Angle Between two vectors.
This has been discussed many times on this forum. Robust methods are found here: https://www.mathworks.com/matlabcentral/answer...

quasi 6 anni fa | 1

Risposto
Discrepancy Between ODE45 and Solve
For dslove, the sin(w*t) signal gets divided by m, which is 10. For ode45, you don't do this, you just have sin(w*t). ...

quasi 6 anni fa | 0

Risposto
mex file update and compile
The use of mxGetDoubles( ) requires that the code is compiled with R2018a or later, and that you use the '-R2018a' option instea...

quasi 6 anni fa | 1

| accettato

Risposto
MEXW64 runs on 2019A but not 2020A (DLL Issue)
Mex routines are not guaranteed to work across MATLAB versions. Sometimes they do and sometimes they don't. It depends on the ...

quasi 6 anni fa | 1

| accettato

Risposto
Complex number when using variables
Operator precedence >> -50.8478 ^ -1.017 ans = -0.0184 >> (-50.8478) ^ -1.017 ans = -0.0184 + 0.0010i The ^ ope...

quasi 6 anni fa | 0

Risposto
Cutting down time of Length(unique(V1)
If all the numbers are integers mod 43, then just n = zeros(1,43); n(V1+1) = 1; D = sum(n);

quasi 6 anni fa | 0

Risposto
How do I solve the nonlinear power equation?
One strategy: Move del Po to the left side Take ln( ) of both sides Put the ln(beta) and n*ln(del P) on one side and the othe...

quasi 6 anni fa | 0

| accettato

Risposto
Matrix(Matrix)
The "a" values are simply being used as row numbers for indexing into b. b(a(:),:) = b([1;2;1;2],:) which is equivalent to [...

quasi 6 anni fa | 0

| accettato

Risposto
Code not working, velocity comes back the same each time
So here is a version of your code with the following changes: Gravity model replaced with the model found here (also note that ...

quasi 6 anni fa | 0

Risposto
MEX error LNK2019:unresolved symbol
mxGetDoubles( ) is a new API routine that only exists in the R2018a+ API memory model. You have to compile with the -R2018a flag...

quasi 6 anni fa | 1

Risposto
Solve equations of Motion using Matlab ODE45
You will have a 4-element state vector instead of 2. initial_cond = [1;1;0;0]; [t,y] = ode45(@(t,y)ODE_funct_fourth_order(t, y...

quasi 6 anni fa | 0

| accettato

Risposto
increase number of decimals
Just type your format at the command line. E.g., format longg

quasi 6 anni fa | 0

| accettato

Risposto
Comparing orbits between a planet and Red Dwarf
To calculate how often stellar eclipses occur for the 2D geometry, on average, yes all you need to do is look at orbit periods. ...

quasi 6 anni fa | 0

| accettato

Risposto
Multiplying 2 matrices together
Use the matrix multiply operator * without the dot. What you are using is the element-wise multiply operator .* with the dot. Tw...

quasi 6 anni fa | 0

Risposto
Code not working, velocity comes back the same each time
Lines like this are wrong: S(i+1)=S(i)+(V(i)*Tstep+0.5*a(i)*Tstep^2); % Displacement at next i You are double booking the effe...

quasi 6 anni fa | 0

Risposto
strange operation .^ result came out
You are raising -1 to a fractional exponent, so complex numbers will result. Did you mean something like this instead t = 0:10...

quasi 6 anni fa | 0

| accettato

Carica altro