Community Profile

photo

James Tursa


Last seen: Today 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

表示方法

回答済み
Is it possible to process the sparse matrix faster with vectorization instead of for loop?
You need to re-evaluate how you are doing things. In the first place, you have the Euclidean calculation wrong. It should be thi...

1日 前 | 0

回答済み
How to exchange data between two C++ MEX files
Your current scheme is not foolproof. How does the 1st mex function know when it is safe to unlock and clear memory? How does th...

1日 前 | 0

| 採用済み

回答済み
How to solve Lc=y without backslash operator?
First, I am assuming there is a typo and the system you are solving is Ly = c, not Lc=y. Second, you made a good start by writi...

4日 前 | 0

回答済み
I am using euler's method to solve a differential equation, but when I run the code it doesn't plot.
Take a look at these lines: t0=0; %start time t1= 500; %finish time dt = 100000; Your stepsize is much larger than the total...

6日 前 | 1

| 採用済み

回答済み
Accessing struct using C library always NULL
Typically, it is best just to post your code so we can see exactly what you are doing, instead of posting a description of your ...

6日 前 | 1

| 採用済み

回答済み
Errors while trying to setup equation for root finding.
Did you mean multiply by the "a"? x_pdo = z_pdo/(1 + a*(k_pdo - 1)); x_water = z_water/(1 + a*(k_water - 1)); x_glycerol = z_...

6日 前 | 0

回答済み
How do I access a field from a function's input?
Assuming you are passing in a character string for freq, use this syntax: output = myStruct.(freq);

8日 前 | 0

| 採用済み

回答済み
How can I obtain the T and Y for R Runge Kutta method?
The first version has an error. This line: k3=h*feval(f,T(j),Y(j)); should be this instead: k3=h*feval(f,T(j)+h/2,Y(j)+k2/2);...

14日 前 | 0

回答済み
How to solve array indices error?
x1 = 0*ft; : distance1=sqrt((x1-x2)^2+(y1-y2)^2+(z1-z2)^2); : sp = distance1(x1,y1,z1,dx,dyv(i),dz); % incident di...

24日 前 | 0

回答済み
Solving ODE using Euler Method and 4th Order Runge Kutta Method
You pretty much have the Euler scheme worked out, so I will help you with a vector formulation. Take this code: for i=1:n ...

28日 前 | 0

| 採用済み

回答済み
Problem finding sum of array using vectorization
The first element of x is 1, so that element produces 1/(1-1) = 1/0 = inf in the second line. You need to rewrite that second li...

約1ヶ月 前 | 0

回答済み
Multiplication of large matrix with its transpose
The fastest way is to simply write it as A * A', because MATLAB will see that the operands are the same and call a special multi...

約1ヶ月 前 | 0

回答済み
Solving ODE in MATLAB using Runge-Kutta method of order 4
Why aren't you using this to update z: z(i+1) = z(i) + (1/6)*(l1+(2*l2)+(2*l3)+l4);

約1ヶ月 前 | 0

回答済み
Why is the string type not implemented as standard type?
All of the standard full numeric types as well as char and logical are implemented as simple rectangular data arrays. The string...

約1ヶ月 前 | 1

回答済み
how to print randomly selected column?
Shouldn't that be size(data,2)? Also, generally you should be using string comparison functions for the tests, not the == opera...

約1ヶ月 前 | 0

回答済み
NaN shows up in matrix when solving my ODEs, how can I fix this?
"All of my matrices I am solving for have NaN after the third time line. How do I solved this issue?" Set up a breakpoint somew...

約1ヶ月 前 | 1

| 採用済み

回答済み
Mean of multidimensional array
Doesn't mean(mdar,3) do what you want?

約1ヶ月 前 | 0

| 採用済み

回答済み
Function Error: Array indices must be positive integers or logical values.
When you have parentheses appear on the left hand side of an assignment like this: v(ro,ri) = (sqrt(m/(ri)))*((1/sqrt(R))-((sqr...

約1ヶ月 前 | 1

| 採用済み

回答済み
MXCREATEDOUBLEMATRIX memory overflow error
Rather later for an Answer, but here goes anyway: You should never use literal integers for API calls, because you can't be sur...

約1ヶ月 前 | 0

回答済み
How can I solve x^4-1=0
doc roots

約1ヶ月 前 | 0

回答済み
Convert unsigned integer to decimal
Not sure what the real question is here. Does one of these do what you want? int1 = uint32(hex2dec('9d900000')); int1 = uint32...

約1ヶ月 前 | 0

回答済み
convert integer to bytes
Depending on what you are doing downstream with this, you can use the typecast( ) function. E.g., bytes = typecast(my_integer,'...

約1ヶ月 前 | 0

| 採用済み

回答済み
Selecting multiple different rows in a 3D matrix
You can use a vector for the indexing. E.g., x = matrix(:,:,[2:16,24:48]); Does that, or something like that, do what you wan...

約1ヶ月 前 | 0

回答済み
Using a variable vector in a loop
Suppose you store the column vectors in a matrix called V. Then vk would simply be V(:,k). And if the uj are stored in a matrix...

約2ヶ月 前 | 1

| 採用済み

回答済み
Fortran code in Matlab
I'm trying to figure out the purpose of the backslash \. If this was the last character in the format statement then I would ass...

約2ヶ月 前 | 0

回答済み
Assigning mxUint16 variable to plhs[0]
You cannot attach native C/C++ memory to an mxArray. The MATLAB API "mxSetEtc" functions check to see that the memory addresses ...

約2ヶ月 前 | 0

| 採用済み

回答済み
How to separate a vector into two different vectors?
Others have already pointed out better ways of doing this. But to answer your question as to why your current code is not workin...

約2ヶ月 前 | 1

回答済み
Nested "For Loop" Array Size
To keep the indexing the same, just use the top value from the loops. E.g., DataArray = nan(300,50,100,numel(inputValsY3)); No...

約2ヶ月 前 | 0

| 採用済み

回答済み
convert value from radian form to degree form
If you have values, then just number_in_radians = number_in_degrees * (pi/180); If you are working with trig functions, note t...

約2ヶ月 前 | 0

回答済み
Calculate taylor series using while loop
Looks like you are planning to use the identity ln(5) = ln((1/5)^-1) = -ln(1/5) and then use 1/5 as the x in the Taylor Series e...

約2ヶ月 前 | 0

もっと読み込む