답변 있음
8 digit double array to 1 digit double array
For column vector H: H_conv = cell2mat(arrayfun(@(x)sprintf('%08d',x),H,'uni',false)) - '0'

대략 6년 전 | 0

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

대략 6년 전 | 0

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

대략 6년 전 | 0

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

대략 6년 전 | 1

| 수락됨

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

대략 6년 전 | 0

| 수락됨

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

대략 6년 전 | 0

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

대략 6년 전 | 0

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

대략 6년 전 | 0

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

대략 6년 전 | 0

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

대략 6년 전 | 0

| 수락됨

답변 있음
How do I rearrange these matrix values?
A = your matrix result = reshape(A,3,4)'

대략 6년 전 | 0

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

대략 6년 전 | 0

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

대략 6년 전 | 0

| 수락됨

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

대략 6년 전 | 3

| 수락됨

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

대략 6년 전 | 0

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

대략 6년 전 | 1

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

대략 6년 전 | 0

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

대략 6년 전 | 1

| 수락됨

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

대략 6년 전 | 1

| 수락됨

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

대략 6년 전 | 0

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

대략 6년 전 | 0

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

대략 6년 전 | 0

| 수락됨

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

대략 6년 전 | 0

| 수락됨

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

대략 6년 전 | 0

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

대략 6년 전 | 1

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

대략 6년 전 | 0

| 수락됨

답변 있음
increase number of decimals
Just type your format at the command line. E.g., format longg

대략 6년 전 | 0

| 수락됨

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

대략 6년 전 | 0

| 수락됨

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

대략 6년 전 | 0

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

대략 6년 전 | 0

더 보기