Community Profile

photo

James Tursa


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

세부 정보 보기...

참여 게시물
보기 기준

답변 있음
Assignment has more non-singleton rhs dimensions than non-singleton subscripts ERROR IN FOR LOOP
x(:,i+1)=x(:,i)+A*x(:,i)+B*u(:,i); % changed u(i) to u(:,i)

약 12시간 전 | 0

| 수락됨

답변 있음
Runge Kutta integration problem - NaN result
You may have a stiff DE and you can't use RK4 with a fixed step size. What happens when you call ode45( ) instead of ode15s( )?...

3일 전 | 0

답변 있음
Calculating the height of a liquid in a sphere using secant method
You need to use a function that is 0 at the h you are looking for. So you need that 30 in your function handle. E.g., func = @(...

3일 전 | 0

| 수락됨

답변 있음
Not enough input arguments
You need to call the function with the N input you just got from the user. E.g., disp(quiz6_func1(x,N))

3일 전 | 1

| 수락됨

답변 있음
ode45 function array error
You have tm(1) = 0, so using tm(1) as an index is invalid: tm=[0 30 etc... : for i=1:length(tm) : Ss_in(tm(i):end)...

4일 전 | 0

답변 있음
Is FORMAT DEBUG still any useful?
Strange behavior and probably deserves a bug report. E.g., R2019a: >> x = 1; >> y = x; >> x = x + 1; >> format debug >> y...

4일 전 | 0

| 수락됨

답변 있음
Precision (decimal digits) are very low and digits(32) does not help.
This is likely just a display issue and you don't need the Symbolic Toolbox. MATLAB does regular calculations in full double pr...

4일 전 | 0

답변 있음
Consecutive subtraction of the entries of a vector
If A is a row vector: B = [A(1) diff(A)]; If A is a column vector: B = [A(1);diff(A)];

4일 전 | 0

| 수락됨

답변 있음
generate random number with total sum is 10
Not sure from your wording if you want the row sums to be 1 or 10. If it is 1, then r = rand(6,1); r(:,2) = 1 - r(:,1); Modif...

4일 전 | 0

| 수락됨

답변 있음
when does changing variable's value affects its structure address?
In addition to what Walter has written, I would point out that all of the rules for variable creation, assignment, and sharing h...

5일 전 | 0

| 수락됨

답변 있음
Replace the numbers in an array
A(~isnan(A)) = B;

5일 전 | 1

답변 있음
Vector ODE using forward Euler method
Also your main code should look something like this: g = 9.8; mu = 0.5; [t,y]=ode45(@(t,y)rhs_1(t,y,g,mu),[0 100],[0.1; 0]); ...

7일 전 | 0

답변 있음
unique function return value of duplicate vector entry
Why can't you just use ind1 and ind2? E.g., V1_1 = V1_1(ind1); V2_1 = V2_1(ind1); V1_2 = V1_2(ind2); V2_2 = V2_2(ind2);

10일 전 | 0

답변 있음
Insignificant modification of code leads to NaN
Think about what is happening with this loop: for i = 1:num_iterates x = A*x; R(:,i) = x/norm(x); %%%% Problem Line %...

18일 전 | 1

| 수락됨

답변 있음
Skip instance of a loop with error
Something like this: try fn = x+y+z; %The function is just a representation. I am actually performing a Fi...

19일 전 | 0

| 수락됨

답변 있음
Performance of applications that are developed in MATLAB versus C++/C
Any such comparison will depend on exactly what computations are in question. A general comparison of languages probably isn't ...

19일 전 | 2

답변 있음
Numerical Integration by Matlab
Hint: You might look here: https://en.wikipedia.org/wiki/Normal_distribution Knowing that the integral of the Normal density f...

20일 전 | 0

답변 있음
Does MEX compiler (and the associated shared files) automatically ship with all MATLAB distributions of any license type?
Mex routines are not guaranteed to be compatible between different versions of MATLAB, for the very dependency reasons you alrea...

20일 전 | 1

| 수락됨

답변 있음
function call returns "index (1.2): subscripts must be either integers 1 to (2^63)-1"
You are missing a multiply operator. There is no implied multiplication in MATLAB with the 2( combination. E.g., u_1 = @(y) ...

22일 전 | 0

답변 있음
Mex, how to copy an array to output
See the solutions I posted here: https://www.mathworks.com/matlabcentral/answers/702682-with-mxmalloc-and-mxsetdoubles-mex-func...

22일 전 | 0

| 수락됨

답변 있음
With mxMalloc() and mxSetDoubles(), mex function crash matlab
You have memory leaks in your current code. E.g., tmpResult = mxMalloc(numRows*numRows*sizeof(*tmpResult)); // this memory ...

22일 전 | 2

| 수락됨

답변 있음
hi I am trying to use this code to solve RK4 equation and I keep receiving this error . what should I do?
Your implementation has several errors: Looks like you are creating i as a vector and then using that for indexing in A(i) You...

24일 전 | 0

| 수락됨

답변 있음
Filling in multidimensional array efficiently
Something like this maybe? k = 1; % your loop b = r x 1800 matrix f = whatever ch = whatever r = size(b,1)...

25일 전 | 0

답변 있음
extract out values out of loop
Make them arrays and assign to the elements. E.g., for i= 1: length(Hi) [XYZ(:,i),H(i),D(i),I(i),F(i)] = wrldmagm(Hi(i),La...

26일 전 | 1

| 수락됨

답변 있음
Projectile motion with drag. My problem is in the loop as the number of elements are not equal apparently on the left and right. Id appreciate detailed input ive been lost on this for a couple of days now
This makes AccDrag a vector: AccDrag(1,:) = [AccDragX(1) AccDragY(1) 0] So here you have a vector on the right hand side and a...

26일 전 | 0

| 수락됨

답변 있음
calling another matrix in a matrix
Don't do this! Creating numbered named variables in your code like yakit_1, yakit_2, etc. leads to downstream coding problems a...

26일 전 | 0

답변 있음
Newton Raphson Method in a for loop
You don't have the Newton-Raphson method coded correctly. You need to update the x value you use for the delta within the loop ...

26일 전 | 0

답변 있음
How to use ode45 to solve a system of two differential equation?
If you don't have the Symbolic Toolbox, here is the procedure: 1) Write your equations in matrix form: F*qdotdot + G*qdot + H*...

26일 전 | 0

답변 있음
Multiplication of large matrices
Do NOT transpose your matrix explicitly before the multiply. That will only cause a deep copy, double the memory footprint, and...

26일 전 | 1

답변 있음
[Matlab Grader] How to check if the matrix has upper triangular form?
This looks like a display issue. The numbers in the lower triangle are not exactly zero, they just display that way out to 4 dig...

26일 전 | 0

| 수락됨

Load more