2 855 total contributions since 2007

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

Answered

How to correct "Parse" error

Don't have your function at the top of this. Put it at the end or in a separate file. E.g., t = 1; while (height ~=0) h =...

How to correct "Parse" error

Don't have your function at the top of this. Put it at the end or in a separate file. E.g., t = 1; while (height ~=0) h =...

4 dagar ago | 0

Answered

I have a matrix (57,3600,45), how can I create matrices with (3600,45)?

Is this what you want? k = some integer index squeeze(your_matrix(k,:,:))

I have a matrix (57,3600,45), how can I create matrices with (3600,45)?

Is this what you want? k = some integer index squeeze(your_matrix(k,:,:))

4 dagar ago | 0

Answered

Square root table without using arrays

You need to put the new line \n in appropriate places in your loops. In particular, you only need one new line \n printed once y...

Square root table without using arrays

You need to put the new line \n in appropriate places in your loops. In particular, you only need one new line \n printed once y...

4 dagar ago | 0

| accepted

Answered

Memory Size and Processor Speed

Yes you can run MATLAB on this. What tasks will you typically be using MATLAB for?

Memory Size and Processor Speed

Yes you can run MATLAB on this. What tasks will you typically be using MATLAB for?

6 dagar ago | 0

| accepted

Answered

How to? - Complex numbers

E.g., for an anonymous function you need to give the input argument list first. E.g., for a generic derivative function that tak...

How to? - Complex numbers

E.g., for an anonymous function you need to give the input argument list first. E.g., for a generic derivative function that tak...

8 dagar ago | 0

Answered

And/or between two 3d arrays

Do you mean this? sum(array1>250 & array2>170,3);

And/or between two 3d arrays

Do you mean this? sum(array1>250 & array2>170,3);

8 dagar ago | 0

Answered

Function in Fortran to Funciton in Matlab

function result = F0(n,x) if( n<2 ) error('bad argument n in F0') end tox=2.0/x; bkm=F00(x); bk=F01(x); for j=1:n-1 ...

Function in Fortran to Funciton in Matlab

function result = F0(n,x) if( n<2 ) error('bad argument n in F0') end tox=2.0/x; bkm=F00(x); bk=F01(x); for j=1:n-1 ...

11 dagar ago | 1

| accepted

Answered

differentiating function & getting different answer

Perhaps you are shadowing the MATLAB function diff with a function of your own. Make sure diff is pointing to the MATLAB functio...

differentiating function & getting different answer

Perhaps you are shadowing the MATLAB function diff with a function of your own. Make sure diff is pointing to the MATLAB functio...

12 dagar ago | 0

Answered

Invalid Syntax at '='.Possibly,a ),} or ] is missing at line 6 .

The { } formulation for blocking code is not valid MATLAB syntax. To fix this: Get rid of the open brace { Replace the close b...

Invalid Syntax at '='.Possibly,a ),} or ] is missing at line 6 .

The { } formulation for blocking code is not valid MATLAB syntax. To fix this: Get rid of the open brace { Replace the close b...

13 dagar ago | 1

| accepted

Answered

use this vector and a mathematical expression to create the following vectors:

Yes. It works for me: >> x= [1, 2, 3, 4 ,5] x = 1 2 3 4 5 >> x1= x.*[1,128,243,64,5] x1 = 1 25...

use this vector and a mathematical expression to create the following vectors:

Yes. It works for me: >> x= [1, 2, 3, 4 ,5] x = 1 2 3 4 5 >> x1= x.*[1,128,243,64,5] x1 = 1 25...

18 dagar ago | 0

Answered

Extracting matrix values for an algorithm

Something like this? xy = your n x 2 array n = size(xy,1); for k=1:n % run your algorithm here with x = xy(k,1) and y = ...

Extracting matrix values for an algorithm

Something like this? xy = your n x 2 array n = size(xy,1); for k=1:n % run your algorithm here with x = xy(k,1) and y = ...

18 dagar ago | 1

| accepted

Answered

Basic power rule ((a^b)^c = a^(b*c)) does not work

This has been discussed in this forum before. Raising complex numbers to a power is a multi-valued operation. MATLAB picks one...

Basic power rule ((a^b)^c = a^(b*c)) does not work

This has been discussed in this forum before. Raising complex numbers to a power is a multi-valued operation. MATLAB picks one...

18 dagar ago | 1

Answered

Is it possible to use logical indexing to specify between a number interval and include a value outside that interval.

E.g., Mask = ismember(str,[' ','a':'z','A':'Z']); Or using your method Mask = (65<=Ustr & Ustr<=90) | Ustr == 32;

Is it possible to use logical indexing to specify between a number interval and include a value outside that interval.

E.g., Mask = ismember(str,[' ','a':'z','A':'Z']); Or using your method Mask = (65<=Ustr & Ustr<=90) | Ustr == 32;

19 dagar ago | 1

| accepted

Answered

BEGINNER PROBLEM: Trying to finish up an assignment but I am stuck with this error and am not sure how to fix

lab_total and assign_total and exam_total are all vectors, so the right hand side expression is a vector. You try to stuff that...

BEGINNER PROBLEM: Trying to finish up an assignment but I am stuck with this error and am not sure how to fix

lab_total and assign_total and exam_total are all vectors, so the right hand side expression is a vector. You try to stuff that...

20 dagar ago | 1

Answered

I have a problem with this ode45

I don't see anywhere in your code where you define i and j before using them as indexes into Phi0 and Z0, so they default to the...

I have a problem with this ode45

I don't see anywhere in your code where you define i and j before using them as indexes into Phi0 and Z0, so they default to the...

20 dagar ago | 0

Answered

Vector matrix multiplication with a condition

For later versions of MATLAB: c = all(A==B | A==2,2); For earlier versions: c = all(bsxfun(@eq,A,B) | A==2,2);

Vector matrix multiplication with a condition

For later versions of MATLAB: c = all(A==B | A==2,2); For earlier versions: c = all(bsxfun(@eq,A,B) | A==2,2);

20 dagar ago | 0

| accepted

Answered

Can ode45 solve a ODE with space dependent parameters?

Yes. In general, if the derivative is a function of current state and time (even if there are vectors or matrices involved), the...

Can ode45 solve a ODE with space dependent parameters?

Yes. In general, if the derivative is a function of current state and time (even if there are vectors or matrices involved), the...

21 dagar ago | 2

| accepted

Answered

Is it possible to set rules for calculating permutations of column vectors?

Use the diff( ) function to calculate all of the permutations, and then count the number of valid ones. E.g., P = perms(1:i...

Is it possible to set rules for calculating permutations of column vectors?

Use the diff( ) function to calculate all of the permutations, and then count the number of valid ones. E.g., P = perms(1:i...

22 dagar ago | 1

| accepted

Answered

Get UNIX standard timestamp on MATLAB

You need to be careful about how you use the posixtime(t) function. From the documentation: "...If the time zone of t is not sp...

Get UNIX standard timestamp on MATLAB

You need to be careful about how you use the posixtime(t) function. From the documentation: "...If the time zone of t is not sp...

ungefär en månad ago | 2

Answered

How can I determine the angle between two vectors in MATLAB?

This topic has been discussed many times on the Newsgroup forum ... if I looked hard enough I'm sure I could find several Roger ...

How can I determine the angle between two vectors in MATLAB?

This topic has been discussed many times on the Newsgroup forum ... if I looked hard enough I'm sure I could find several Roger ...

ungefär 2 månader ago | 3

Answered

"To RESHAPE the number of elements must not change".This error occurs in line18.how to correct this error?

This expression is only going to work if size(a,1)*size(a,1) = numel(a): reshape(a,size(a,1),size(a,1),1); What are you trying...

"To RESHAPE the number of elements must not change".This error occurs in line18.how to correct this error?

This expression is only going to work if size(a,1)*size(a,1) = numel(a): reshape(a,size(a,1),size(a,1),1); What are you trying...

ungefär 2 månader ago | 0

Answered

Matlab crashes but Octave doesn't

What happens if you do the A\b differently? E.g., doing the LU decomposition manually and then backsolving yourself? Or doing pi...

Matlab crashes but Octave doesn't

What happens if you do the A\b differently? E.g., doing the LU decomposition manually and then backsolving yourself? Or doing pi...

ungefär 2 månader ago | 0

| accepted

Answered

R2018b real times complex multiplication

Probably related to the fact that complex variables changed to an interleaved storage format in R2018a. So my guess is this is w...

R2018b real times complex multiplication

Probably related to the fact that complex variables changed to an interleaved storage format in R2018a. So my guess is this is w...

ungefär 2 månader ago | 2

| accepted

Answered

Write a function called WordProduct to calculate the alphabetic word product of a character vector.

Hints to get you started: Look at the upper( ) and lower( ) functions What happens if you subract 'a' or 'A' from your vector?...

Write a function called WordProduct to calculate the alphabetic word product of a character vector.

Hints to get you started: Look at the upper( ) and lower( ) functions What happens if you subract 'a' or 'A' from your vector?...

ungefär 2 månader ago | 0

Answered

Changing elements with a condition

clear X2 X3 [m,n] = size(X1); X2(2:m,2:n) = X1(1:m-1,1:n-1); X3(3:m,3:n) = X1(1:m-2,1:n-2);

Changing elements with a condition

clear X2 X3 [m,n] = size(X1); X2(2:m,2:n) = X1(1:m-1,1:n-1); X3(3:m,3:n) = X1(1:m-2,1:n-2);

ungefär 2 månader ago | 1

| accepted

Answered

I dont understand the vectors and element parts.

Typo. This j*y*(1) <-- Uses the full vector y times the scalar 1 should be this j*y(1) <-- Uses only the y(1) element

I dont understand the vectors and element parts.

Typo. This j*y*(1) <-- Uses the full vector y times the scalar 1 should be this j*y(1) <-- Uses only the y(1) element

2 månader ago | 0

| accepted

Answered

Efficient indexing with nested object and object arrays

Whether this works or not depends on what is in the properties, but have you tried simple concatenation on the rhs? [out] = [pa...

Efficient indexing with nested object and object arrays

Whether this works or not depends on what is in the properties, but have you tried simple concatenation on the rhs? [out] = [pa...

2 månader ago | 0

Answered

Matlab not squaring imaginary part of complex number.

Squaring complex numbers does not in general result in real numbers. It all depends on the phase angles involved (would need to ...

Matlab not squaring imaginary part of complex number.

Squaring complex numbers does not in general result in real numbers. It all depends on the phase angles involved (would need to ...

2 månader ago | 0

Answered

find roots of determinant

Since the determinant of a matrix is equal to the product of its eigenvalues, maybe you could work with eig(A(x)) instead and tr...

find roots of determinant

Since the determinant of a matrix is equal to the product of its eigenvalues, maybe you could work with eig(A(x)) instead and tr...

2 månader ago | 0

Answered

Rotation Matrix with euler angles

The best I can guess is you are given three Euler angles with a sigma for noise, and you want to output a corresponding rotation...

Rotation Matrix with euler angles

The best I can guess is you are given three Euler angles with a sigma for noise, and you want to output a corresponding rotation...

2 månader ago | 0

| accepted