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

All

RANK**16**

REPUTATION**12.295**

CONTRIBUTIONS

**17** Questions

**3.953** Answers

ANSWER ACCEPTANCE **
35.29%
**

VOTES RECEIVED**2.191**

RANK**166**

REPUTATION**7.133**

AVERAGE RATING**4.60**

CONTRIBUTIONS**32** Files

DOWNLOADS **187**

ALL TIME DOWNLOADS**66758**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

Answered

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

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

3 días ago | 0

Answered

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

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

3 días ago | 0

Answered

Can you help me with this loop?

Can you use num2str? Message = [num2str(TotalMinutes) ' minutes are equal to ' num2str(Hours) ' hours and ' num2str(Minutes) ' ...

Can you help me with this loop?

Can you use num2str? Message = [num2str(TotalMinutes) ' minutes are equal to ' num2str(Hours) ' hours and ' num2str(Minutes) ' ...

7 días ago | 0

Answered

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

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

7 días ago | 1

Answered

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

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

7 días ago | 0

Answered

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

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

9 días ago | 0

| accepted

Answered

Fast vector reshaping/permutation

Don't do the permute( ) operation. Just use pagemtimes( ) downstream in your code with the appropriate 'transpose' option. Thi...

Fast vector reshaping/permutation

Don't do the permute( ) operation. Just use pagemtimes( ) downstream in your code with the appropriate 'transpose' option. Thi...

10 días ago | 1

Answered

Can someone explain this Loop?

Of the numbers 1 ... 10 that get produced by the randperm( ) call, only three of them are less than 4: 1, 2, 3. 1 will cause n...

Can someone explain this Loop?

Of the numbers 1 ... 10 that get produced by the randperm( ) call, only three of them are less than 4: 1, 2, 3. 1 will cause n...

11 días ago | 0

| accepted

Answered

How to generate unique random integers between 1 to n (with no possibility of Sequence)

If 1:n is the only sequence you don't want, just use randperm(n) and reject the one case you don't want. I.e., if you get it the...

How to generate unique random integers between 1 to n (with no possibility of Sequence)

If 1:n is the only sequence you don't want, just use randperm(n) and reject the one case you don't want. I.e., if you get it the...

14 días ago | 0

Answered

How do solve four variables with one equation using Runge-kutta?

You have three state variables, namely v, lc, and z. But you only have code for updating v. You need code for updating lc and ...

How do solve four variables with one equation using Runge-kutta?

You have three state variables, namely v, lc, and z. But you only have code for updating v. You need code for updating lc and ...

14 días ago | 1

| accepted

Answered

A code and plot a graph for a projectile motion of a ball

Your main problem is that you don't have enough state variables. You have these two equations: x'' = 0 y'' = -g That's two 2...

A code and plot a graph for a projectile motion of a ball

Your main problem is that you don't have enough state variables. You have these two equations: x'' = 0 y'' = -g That's two 2...

14 días ago | 0

Answered

Converting Struct field to array

Does this do what you want? MyMatrix = vertcat(MyStruct.Field);

Converting Struct field to array

Does this do what you want? MyMatrix = vertcat(MyStruct.Field);

16 días ago | 0

| accepted

Answered

Trying to build a new nx4 array from an existing nx4 array using logical values

Assuming quatAB is a standard numeric matrix, use your logical variable for the first index and colon for the second index: m =...

Trying to build a new nx4 array from an existing nx4 array using logical values

Assuming quatAB is a standard numeric matrix, use your logical variable for the first index and colon for the second index: m =...

17 días ago | 0

Answered

How do I combine a structure array into one structure

F = fieldnames(A); n = numel(F); C = arrayfun(@(i)vertcat(A.(F{i})),1:n,'uni',false); FC = [F';C]; B = struct(FC{:});

How do I combine a structure array into one structure

F = fieldnames(A); n = numel(F); C = arrayfun(@(i)vertcat(A.(F{i})),1:n,'uni',false); FC = [F';C]; B = struct(FC{:});

17 días ago | 0

Answered

Finding optimal value for x

You could try this function to get numeric values for local minimums: https://www.mathworks.com/help/matlab/ref/fminsearch.html...

Finding optimal value for x

You could try this function to get numeric values for local minimums: https://www.mathworks.com/help/matlab/ref/fminsearch.html...

18 días ago | 0

Answered

Using fprintf to save a matrix changes the order of my matrix

MATLAB stores 2D matrices in column order. That is, the numbers in your matrix are stored in memory in this order: 0, 1, 2, 3,...

Using fprintf to save a matrix changes the order of my matrix

MATLAB stores 2D matrices in column order. That is, the numbers in your matrix are stored in memory in this order: 0, 1, 2, 3,...

18 días ago | 0

Answered

please help me to convert c code into matlab code for partial shading of solar panel using equilibration algorithm

In addition to what @Image Analyst has written, I would advise turning this into a function with p1, p2, p3 as input arguments a...

please help me to convert c code into matlab code for partial shading of solar panel using equilibration algorithm

In addition to what @Image Analyst has written, I would advise turning this into a function with p1, p2, p3 as input arguments a...

18 días ago | 0

Answered

Difference between using single quotes ('xyz') and double quotes ("xyz") in formatspec

In MATLAB, single quotes ' ' are used to create char type variables, and double quotes " " are used to create string type variab...

Difference between using single quotes ('xyz') and double quotes ("xyz") in formatspec

In MATLAB, single quotes ' ' are used to create char type variables, and double quotes " " are used to create string type variab...

24 días ago | 0

| accepted

Answered

Error in ode45 while doing numerical integration

The function handle you pass to ode45( ) needs to have a (t,y) signature. E.g., [t,y] = ode45(@(t,y) myode(t,gt,g), tspan, ic, ...

Error in ode45 while doing numerical integration

The function handle you pass to ode45( ) needs to have a (t,y) signature. E.g., [t,y] = ode45(@(t,y) myode(t,gt,g), tspan, ic, ...

24 días ago | 0

Answered

How to multiply higher order matrices?

You may need to permute your arrays first to get your desired 2D slices in the first two dimensions. A = whatever B = whatever...

How to multiply higher order matrices?

You may need to permute your arrays first to get your desired 2D slices in the first two dimensions. A = whatever B = whatever...

alrededor de 1 mes ago | 2

Answered

Using matrix to index another matrix?

Does this do what you want: x = sub2ind(size(B),(1:size(A,1))',A(:,1),A(:,2),A(:,3)); Output = B(x);

Using matrix to index another matrix?

Does this do what you want: x = sub2ind(size(B),(1:size(A,1))',A(:,1),A(:,2),A(:,3)); Output = B(x);

alrededor de 1 mes ago | 0

| accepted

Answered

Equivalent of c++'s NULL or python' s None in MATLAB

This will probably depend on how these are used downstream in your code and whether you have arrays of them to deal with. If th...

Equivalent of c++'s NULL or python' s None in MATLAB

This will probably depend on how these are used downstream in your code and whether you have arrays of them to deal with. If th...

alrededor de 1 mes ago | 1

Answered

X Y Z angles of a D20 (icosahedron) for gravity projection

If you have the 3D normal vectors, then all you need to do is take the dot product between them and the "flat" face normal vecto...

X Y Z angles of a D20 (icosahedron) for gravity projection

If you have the 3D normal vectors, then all you need to do is take the dot product between them and the "flat" face normal vecto...

alrededor de 1 mes ago | 1

| accepted

Answered

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

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

alrededor de 1 mes ago | 0

Answered

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

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

alrededor de 1 mes ago | 0

Answered

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

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

alrededor de 1 mes ago | 0

Answered

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

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

alrededor de 1 mes ago | 0

Answered

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

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

alrededor de 1 mes ago | 1

Answered

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

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

alrededor de 1 mes ago | 0

Answered

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

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

alrededor de 1 mes ago | 1