Community Profile

photo

James Tursa


2,872 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 バッジ

  • 36 Month Streak
  • Thankful Level 2
  • Ace
  • Revival Level 2
  • Knowledgeable Level 4
  • First Answer
  • Solver

詳細を表示...

貢献した分野
表示方法

回答済み
what does this code represents? and why rand() has no value between parentheses?
rand() is the same as rand without the parentheses ... they both simply call the rand function with no input arguments. The beh...

2日 前 | 0

回答済み
Solve 10 system of ODEs with separate functions and time dependent factors
This isn't going to work. You can't use random values in the derivative function for ode45. The derivative calls that ode45 mak...

2日 前 | 1

回答済み
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
What is size(dist) and size(v_e)? If these are row vectors, then maybe you need to do e*e' instead to get a scalar result.

2日 前 | 0

回答済み
Loop through specific strcuture field names
As Stephen says, this is going to be slow. But maybe this syntax using dynamic field names would be useful to you: R{i}.([name...

2日 前 | 0

回答済み
Create new cell array based on entries of other cell arrays
Not sure if this will suffice for your needs, but a simple way to get the unique strings in alphabetical order: arr4 = unique([...

3日 前 | 0

| 採用済み

回答済み
Normalizing a complex number
It is not clear what you are trying to do. You use the word "normalize" but it looks like maybe you are just trying to find the ...

4日 前 | 0

回答済み
Which is more efficient: iteratively filling in a sparse matrix vs. creating a new sparse matrix every time i need to update the matrix?
Iteratively changing a sparse matrix causes the entire data set to be copied each time, so this is inherently not efficient and ...

9日 前 | 0

回答済み
I have a matrix eg [1,6,3], and i have a 31*1 cell array ,each element of cell is a matrix. My problem is i wants to extract matrix from the cell position {1*1},{6*1},{3*1} and to be stored all these in separate matrices.
E.g., is this what you want? c = your 31x1 cell array v = your vector of indexes, e.g. [1,6,3] result = c(v); % extract the c...

10日 前 | 0

| 採用済み

回答済み
Error was detected while a MEX-file was running and MATLAB is exiting because of fatal error
Can you explain what you intended with these lines for A: double **A; : A = (double**)mxGetPr(prhs[0]); If y...

10日 前 | 0

| 採用済み

回答済み
inconsistency when comparing cell arrays with strings vs char array
This is a really good question. E.g., >> version ans = '9.4.0.813654 (R2018a)' >> strcmp("abcd","abcd") ans = logica...

16日 前 | 0

回答済み
Voltage Measurement block: "do not delete this again". What is the story behind this?
Do not delete this "gain" ... not "again" P.S. Mathworks employees do have a sense of humor ... just not for this particular ca...

16日 前 | 1

| 採用済み

回答済み
Array Indexing Logical Values
"We know that rounding the index prevents the error" So that's a big clue. "Is there a hidden decimal place not being shown to...

20日 前 | 0

回答済み
Matlab crashes when i create output matrix in mex.
I haven't had much time to look at this in detail, but at first glance this stands out: void createTable(unsigned int *dataStre...

26日 前 | 0

回答済み
hi everybody , i have a question please , if i have X=[1:10] and Y=[-5:5] and i want to have all the point of the plane (x,y) , what can i do in matlab to extract this point to use it
Does this do what you want? [x,y] = meshgrid(X,Y); result = [x(:),y(:)]; Then iterate over the rows of result. Or you can ju...

27日 前 | 0

| 採用済み

回答済み
summation of sinx using summation
You are missing the alternating signs of the terms. E.g., you could put in a factor of (-1)^something to get this effect. The ...

約1ヶ月 前 | 0

回答済み
How to concatenate each row of a matrix into a vector ?
result = char(A+'0');

約1ヶ月 前 | 1

回答済み
Index exceeds the number of array elements (1)
Type the following at the command line: dbstop if error Then run your code. When the error occurs, the code will pause at that...

約1ヶ月 前 | 0

回答済み
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 =...

約1ヶ月 前 | 0

回答済み
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,:,:))

約1ヶ月 前 | 0

回答済み
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...

約1ヶ月 前 | 0

| 採用済み

回答済み
Memory Size and Processor Speed
Yes you can run MATLAB on this. What tasks will you typically be using MATLAB for?

約1ヶ月 前 | 0

| 採用済み

回答済み
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...

約1ヶ月 前 | 0

| 採用済み

回答済み
And/or between two 3d arrays
Do you mean this? sum(array1>250 & array2>170,3);

約1ヶ月 前 | 0

回答済み
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 ...

約1ヶ月 前 | 1

| 採用済み

回答済み
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...

約2ヶ月 前 | 0

回答済み
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...

約2ヶ月 前 | 1

| 採用済み

回答済み
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...

約2ヶ月 前 | 0

回答済み
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 = ...

約2ヶ月 前 | 1

| 採用済み

回答済み
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...

約2ヶ月 前 | 1

回答済み
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;

約2ヶ月 前 | 1

| 採用済み

Load more