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

Answered

Multiple names for a single variable.

There are no "variable pointers" in MATLAB, so no generic alias capability as you would probably want. Other options to conside...

Multiple names for a single variable.

There are no "variable pointers" in MATLAB, so no generic alias capability as you would probably want. Other options to conside...

alrededor de 13 horas ago | 2

Answered

How to locate and link with the exact same Intel MKL that MATLAB is shipped with?

On my Win64 machine I find them here [matlabroot '/extern/lib/win64/microsoft'] and here [matlabroot '/extern/lib/win64/mingw...

How to locate and link with the exact same Intel MKL that MATLAB is shipped with?

On my Win64 machine I find them here [matlabroot '/extern/lib/win64/microsoft'] and here [matlabroot '/extern/lib/win64/mingw...

alrededor de 15 horas ago | 0

Answered

Use Gaussian Jordan Elimination to convert binary matrix to All zero Matrix

Here is the code, which implements your stated algorithm directly. The input n is the known size of the upper triangular block ...

Use Gaussian Jordan Elimination to convert binary matrix to All zero Matrix

Here is the code, which implements your stated algorithm directly. The input n is the known size of the upper triangular block ...

1 día ago | 0

Answered

MATLAB Smallest Integer in floating point number system

IEEE double has a 52-bit mantissa, plus there is a hidden bit, so effectively 53-bit mantissa. So you can exactly represent all ...

MATLAB Smallest Integer in floating point number system

IEEE double has a 52-bit mantissa, plus there is a hidden bit, so effectively 53-bit mantissa. So you can exactly represent all ...

1 día ago | 0

| accepted

Answered

Find elements in vector that satisfy condition

X = your big matrix k = column number you want to examine value = some number you are looking for idx = (X(:,k) == value); % ...

Find elements in vector that satisfy condition

X = your big matrix k = column number you want to examine value = some number you are looking for idx = (X(:,k) == value); % ...

1 día ago | 0

| accepted

Answered

Array Cascade Addition calculation

One way using implicit array expansion: D = A(:) + reshape(B,1,[]) + reshape(C,1,1,[]); Your results are the elements of D. I...

Array Cascade Addition calculation

One way using implicit array expansion: D = A(:) + reshape(B,1,[]) + reshape(C,1,1,[]); Your results are the elements of D. I...

5 días ago | 0

| accepted

Answered

Getting NaN in Rung-Kutta 4, Simulation of 10 planets

OK, I will take a look at things. But your attempt at "simplifying" your numbers by using a custom distance unit and apparently...

Getting NaN in Rung-Kutta 4, Simulation of 10 planets

OK, I will take a look at things. But your attempt at "simplifying" your numbers by using a custom distance unit and apparently...

5 días ago | 0

Answered

Fill in a data vector into a preallocated zeros matrix

m = reshape(v,500001,4);

Fill in a data vector into a preallocated zeros matrix

m = reshape(v,500001,4);

6 días ago | 0

| accepted

Answered

Multiplication of 2 sets to get all possible outcomes

This is a simple outer product: c = a' * sin(b);

Multiplication of 2 sets to get all possible outcomes

This is a simple outer product: c = a' * sin(b);

6 días ago | 0

Answered

array indices and bisector method

It is not clear what z is supposed to be used for in these lines: z(xL) = PDFunction (m,k,xL); z(xU) = PDFunction (m,k...

array indices and bisector method

It is not clear what z is supposed to be used for in these lines: z(xL) = PDFunction (m,k,xL); z(xU) = PDFunction (m,k...

6 días ago | 0

Answered

Matrix multiplication accuracy problem

This difference is this: R0=A'*A; In the above expression, you are using the exact same matrix A on both sides of the operatio...

Matrix multiplication accuracy problem

This difference is this: R0=A'*A; In the above expression, you are using the exact same matrix A on both sides of the operatio...

6 días ago | 1

| accepted

Answered

multiplication of multiple type matrices

Matrix multiplication is associative, so the order of the multiplication doesn't matter mathematically. You might get small dif...

multiplication of multiple type matrices

Matrix multiplication is associative, so the order of the multiplication doesn't matter mathematically. You might get small dif...

6 días ago | 0

Answered

Advantages of mwsize (Cross-Platform Flexibility)?

"Furthermore, a question arose regarding the 'MATLAB Support for Interleaved Complex API in MEX Functions'. Which API is preferr...

Advantages of mwsize (Cross-Platform Flexibility)?

"Furthermore, a question arose regarding the 'MATLAB Support for Interleaved Complex API in MEX Functions'. Which API is preferr...

7 días ago | 0

Answered

How do i transform a second grade ODE into coordinates?

Looks like motion is restricted to be on the x-y plane, so r is 2D. You have a 2nd order ODE in a 2D frame, so that means you h...

How do i transform a second grade ODE into coordinates?

Looks like motion is restricted to be on the x-y plane, so r is 2D. You have a 2nd order ODE in a 2D frame, so that means you h...

9 días ago | 1

| accepted

Answered

Runge-Kutta 4 implemetation blowing up

s(:,i+1) = s(:,i) + 1/6*(k1 + 2*k2 + 2*k3 + k4); % changed s(:,i+1) to s(:,i) on rhs

Runge-Kutta 4 implemetation blowing up

s(:,i+1) = s(:,i) + 1/6*(k1 + 2*k2 + 2*k3 + k4); % changed s(:,i+1) to s(:,i) on rhs

9 días ago | 0

Answered

Need help with error checking

There are various ways to code this, but keeping the same basic architecture you have chosen you could do this: while( true ) ...

Need help with error checking

There are various ways to code this, but keeping the same basic architecture you have chosen you could do this: while( true ) ...

10 días ago | 0

Answered

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)

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 días ago | 0

| accepted

Answered

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( )?...

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( )?...

14 días ago | 0

Answered

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 = @(...

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 = @(...

14 días ago | 0

| accepted

Answered

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))

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))

14 días ago | 1

| accepted

Answered

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)...

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)...

15 días ago | 0

Answered

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...

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...

15 días ago | 0

| accepted

Answered

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...

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...

15 días ago | 0

Answered

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)];

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)];

15 días ago | 0

| accepted

Answered

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...

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...

15 días ago | 0

| accepted

Answered

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...

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...

16 días ago | 0

| accepted

Answered

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]); ...

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]); ...

18 días ago | 1

Answered

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);

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);

21 días ago | 0