Community Profile

photo

James Tursa


Last seen: 1일 전 2007 이후 활성

Interested in external applications, mex & engine applications with Fortran, C, C++, etc, particularly in the areas of speed improvement and memory management efficiencies.

Statistics

All
  • Revival Level 3
  • Master
  • Personal Best Downloads Level 3
  • First Review
  • 5-Star Galaxy Level 5
  • First Submission
  • 36 Month Streak
  • Thankful Level 2
  • Knowledgeable Level 4
  • First Answer
  • Solver

배지보기

Content Feed

보기 기준

답변 있음
Matrix product using for/while loop
The inner most loop needs to iterate over the 2nd index of M1, not the first index. E.g., while (k<=size(M1,2)) %<-- 2nd inde...

1일 전 | 0

답변 있음
What does 'li' mean?
1i is used to ensure it isn't confused with a variable named i that you might have in the workspace. I.e., 1i is always sqrt(-1...

3일 전 | 0

답변 있음
I have matrix A and I need to find (e^(At)) where t is the sampling time. How to find that? Also what is the difference between exp(A) and expm(A)?
exp(A) just takes the exp( ) of the scalar elements individually. I.e., exp(A(1,1)), exp(A(1,2)), etc. expm(A) takes the matri...

3일 전 | 1

| 수락됨

답변 있음
help with my 4th order runge kutta code
My guess without seeing the rest of your code is that phi is a column vector, so when you add phi*h to the row vector Y(i,:) it ...

5일 전 | 0

| 수락됨

답변 있음
how to change from for loop to while loop
You never change i or Errors within the while loop, so how is the loop ever supposed to exit? Maybe you want to add this line: ...

5일 전 | 0

답변 있음
Is mxCopyPtrToInteger4() not compatible with Interleaved Complex API ?
See this post: https://www.mathworks.com/matlabcentral/answers/93860-why-does-the-fortran-mex-api-function-mxcopyptrtointeger4-...

15일 전 | 0

| 수락됨

답변 있음
What should go in a next-generation MATLAB X?
Symmetric variables and Hermitian variables. MATLAB could implement bit flags in the mxArray header to indicate this and they c...

17일 전 | 0

답변 있음
Why indexing vs not indexing the 2D matrix will lead to different result?
Some links related to this known behavior: https://www.mathworks.com/matlabcentral/answers/599818-computational-complexity-of-m...

17일 전 | 0

답변 있음
Properly resizing mxCreateStructMatrix post-2018a?
TMW doesn't publish the complete rules for how the data areas of structs are organized, but historically they have always put ea...

24일 전 | 0

답변 있음
How to get the ceofficients of a expression derived by ODE or integral ? For exampli,C1 and C2 in u
Typically these would be obtained by combining the solution with initial values for u. Do you have initial values?

약 2달 전 | 0

답변 있음
Conversion Wolfram Mathematica to Matlab (Do loop)
result = sum(1:100);

2달 전 | 0

답변 있음
Is it possible to vectorize this 'for loop' involving multiple matrix inversions
You might look at this FEX submission by Bruno Luong: https://www.mathworks.com/matlabcentral/fileexchange/24260-multiple-same-...

3달 전 | 0

| 수락됨

답변 있음
Mulitplying 3D matrix by 3D matrix - result being 4D.
result = pagemtimes(matrix1,reshape(matrix2,3,512,1,512));

3달 전 | 0

| 수락됨

답변 있음
Matrix dimensions must agree error problem
Use element-wise division with the dot: Y=acosd(sin(altitude)*sin(latitude)-sin(declination)./(cos(altitude)*cos(latitude))); ...

3달 전 | 0

답변 있음
Combining two Matrices every other row
You could do direct assignment. E.g., [m,n] = size(A); C = zeros(2*m,n); C(1:2:end,:) = A; C(2:2:end,:) = B;

3달 전 | 0

답변 있음
Gauss-Elimination method
See the rank( ) function: https://www.mathworks.com/help/matlab/ref/rank.html?s_tid=doc_ta

3달 전 | 1

답변 있음
Looping num2str
x(i) references a single element of x. However, the expression [num2str(y(i)),'%'] generates multiple characters. In essence, ...

3달 전 | 1

답변 있음
Mean computaion in matlab
You can specify the dimension to use with the mean( ) function. E.g., maybe this is the computation you want: data = your 3D m...

3달 전 | 0

답변 있음
What is the mean?
B' is the complex conjugate transpose of B. If B is real, then it is equivalent to just the tranpose and the assignment simply ...

3달 전 | 0

| 수락됨

답변 있음
How can I model equation of motion (2nd order ODE) when system matrices are in terms of state variables?
Yes you can have derivative functions that depend on state variables. This is quite common. E.g., define a 4x1 state vector y th...

3달 전 | 0

답변 있음
empty double matrix in case of nul value
Do you mean you want to do something like this: if( isempty(malicious) ) malicious = 0; end

4달 전 | 0

답변 있음
To allocate character array='2a'
'2a' is a two element character string. You can't assign two elements to a single element. I.e., you can't assign a 1x2 vector...

4달 전 | 0

답변 있음
How to get the desired quaternion representation from a rotation matrix?
As you already know, both q and -q represent the same rotation. Which sign to pick is entirely up to the underlying algorithm. ...

4달 전 | 0

| 수락됨

답변 있음
Implementation of Runge Kutta Numerical Solution for system of ODE's
The main technical problem (other than your syntax not being MATLAB) is that you are trying to solve your four 1st order equatio...

4달 전 | 0

| 수락됨

답변 있음
How to convert complex float to complex integer in MEX gateway function?
I would guess you can just use the appropriate data types. E.g., mxComplexInt32* Data1 = mxGetComplexInt32s(prhs[0]); mxComp...

4달 전 | 0

| 수락됨

답변 있음
Can you help me with this loop?
Can you use num2str? Message = [num2str(TotalMinutes) ' minutes are equal to ' num2str(Hours) ' hours and ' num2str(Minutes) ' ...

4달 전 | 0

답변 있음
How to separate a string(1x1 cell) into a 1x4 cell
If the hex codes are always 8 characters, why can't you just pick off the characters you want? E.g., {result(1:8),result(10:17...

4달 전 | 1

답변 있음
how to generate a code for solving 2st order differential equations using improved runge kutta 4th order method
The posted code actually has a bug. Also it is almost set up properly for vector solutions, but not quite. Make these changes:...

4달 전 | 0

답변 있음
Computer crashed when calculating matrix (mixed with sparse and full) multiplication and summation
Remember that each element of the B*C result is simply the dot product of a row of B with a column of C. If that column of C ha...

4달 전 | 0

| 수락됨

답변 있음
Fast vector reshaping/permutation
Don't do the permute( ) operation. Just use pagemtimes( ) downstream in your code with the appropriate 'transpose' option. Thi...

4달 전 | 1

더로드