Community Profile

photo

James Tursa


Last seen: Today
3,984 2007 年以降の合計貢献数

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

連絡する

James Tursa's バッジ

  • 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

詳細を表示...

貢献した分野
表示方法

回答済み
modify a row of an array within a function
This can sometimes be done inplace depending on how you write the function and how you call the function. One requirement is yo...

約3時間 前 | 0

回答済み
Operator '-' is not supported for operands of type 'function_handle'.
You are using u as both an input argument and a global function handle function A3 = odeFun(t, u) <-- input argument global R...

約21時間 前 | 0

回答済み
Solve a system of 3 second order ODE
You will need to change your scalar equations to vector equations, and you will need to change your derivative function to a vec...

約22時間 前 | 0

回答済み
Need to speed up the generation of random numbers.
You could over generate a large matrix and then pick off the number of elements you need later. E.g., C = rand([5 size(A)]); T...

1日 前 | 0

回答済み
How do i create a large matrix with a formula?
N = 1000; a = 2 * pi * f * T * (0:N-1)'; x = [cos(a) -sin(a)];

1日 前 | 1

回答済み
Matrix multiplication to get covariance matrix
@Tintin Milou MATLAB variables do not have a "symmetric" attribute flag that I know of. Just because you create a variable that...

1日 前 | 0

回答済み
Why can't complex integer arithmetic be done?
I think the main reason for disallowing integer array arithmetic in MATLAB is because of the ambiguity caused by the max(min( ))...

4日 前 | 1

回答済み
How can I split C/C++ Code in multiple files and still use MEX
Use the -c option to compile the B and C stuff to produce only object files without any linking: mex -c B.c C.c Then compile y...

7日 前 | 1

| 採用済み

回答済み
Matrix multiplication. Trying to get scalar solution
Those should be matrix multiples, not element-wise multiplies. Remove the dots. E.g., top=nMode * M * u0; bot=nMode * M * nM...

9日 前 | 0

| 採用済み

回答済み
Adapt RK4 ODE Solver from first order to 2nd order
Try this for starters yt = zeros(numel(y0),length(h:tfinal)); %Memory Allocation And then maybe this is what is intended for i...

11日 前 | 0

| 採用済み

回答済み
Error using vertcat Dimensions of arrays being concatenated are not consistent.
You have a mismatch in the number of arguments. E.g., this [V,y] = ode45(@(~,y) fun(del_h1,del_cp1,cp1),Vspan,y0); should be ...

12日 前 | 0

回答済み
Replacing matrix n column values
E.g., temp = A(:,70:80); temp(temp<0) = 0; A(:,70:80) = temp;

12日 前 | 1

| 採用済み

回答済み
Solving an overdetermined system of linear equations
Since you can simply plug in those values to verify that they satisfy all four equations, the conclusion would be that you have ...

12日 前 | 0

| 採用済み

回答済み
How to create a cell array with binary numbers?
Your pop variable has 1000x11 = 11000 elements. Your for-loop only assigns values to 1000 of those elements (the first column)....

12日 前 | 0

回答済み
Vector sum of forces
sqrt(sum(F.*F,2))

13日 前 | 0

回答済み
invalid use of operator
You are missing a ( after the second "if", and you are missing an "end" statement. That being said, my suggestion would be to u...

15日 前 | 0

回答済み
Need Help Solving Two Coupled ODEs
The derivative function needs to have the input arguments specified. In your current code above, you have no inputs specified. ...

19日 前 | 0

| 採用済み

回答済み
Versions of Euler Methods
methodA has a fundamental flaw: y(i+1) = y(i)+ h*func( t(i) + h/2, (y(i)+y(i+1))/2 ); You can't use y(i+1) on the right hand s...

19日 前 | 1

回答済み
Problem with matrix differential equation resolve in Matlab with ode45
Normally I would have expected ode45( ) to pass q as a 4x1 column vector. Also, I don't see anything in your code solving for q...

22日 前 | 0

| 採用済み

回答済み
Question regarding quaternion conventions; particularly with respect to point vs frame rotations
See this post for comments regarding "point" vs "frame" convention: https://www.mathworks.com/matlabcentral/answers/524471-what...

22日 前 | 0

回答済み
Using vectorization to shorten run time
E.g., [P,D] = meshgrid(p,d); % generate all possible combinations X = [P(:) D(:)]; % combine them into side-by-side column vec...

26日 前 | 1

| 採用済み

回答済み
why does dimension of input variable change in ode45
The dimension changes to a column vector because that is the way ode45( ) operates. Your derivative function needs to be able t...

26日 前 | 1

| 採用済み

回答済み
Maatlab crash with .mex function
I had to make some assumptions about how the matrix data areas are supposed to be loaded. We can try this first to see if these...

26日 前 | 0

回答済み
How to calculate standard deviation in double for loop?
The short answer is don't do that. This style of programming has many problems. See this link for alternatives: https://www.m...

27日 前 | 0

回答済み
Add row to an empty array if a condition is fulfilled
No need for an explicit loop. Just use logical indexing: result = m(strcmp(m(:,3),'A'),:);

27日 前 | 0

| 採用済み

回答済み
reproduce random numbers for the third dimension
If you don't want the random numbers to change from iteration to iteration, then don't regenerate them inside the loop. Calcula...

27日 前 | 0

| 採用済み

回答済み
Using an Array as an input
The error message actually tells you exactly what to do. Use element-wise operator .^ instead of the matrix operator ^ Energy ...

27日 前 | 1

回答済み
Runge-Kutta 2
The + 4.*x1 should be - 4.*x1 in your derivative function. Also, using both X1 and x1 and X2 and x2, even though MATLAB is case...

27日 前 | 0

| 採用済み

回答済み
3D array of rotation matrices multiplied on 2D array of vectors
To answer your side question of how to transpose 2D pages of an array, you can use the permute function to swap the first two di...

27日 前 | 0

回答済み
Passing structs/objects to functions
MATLAB typically passes shared data copies of input arguments to functions. That means creating a separate mxArray header for t...

29日 前 | 0

Load more