Answered
"Partial" matrix multiplication
If you have a C compiler installed, you can use an FEX submission called mtimesx which does nD matrix multiply with built-in tra...

11 years ago | 0

Answered
Need to find out errors in mex
Remember the advice I gave you about abandoning your desire to maintain the multi-level [ ][ ] indexing scheme when using dynami...

11 years ago | 3

| accepted

Answered
How can I get a 3D rotation matrix
You can't have a rotation matrix that rotates all vectors in 3D space such that the angle between the original and rotated vecto...

11 years ago | 1

Answered
Make matrix from input size
doc ndgrid Look at combining the results with your 1:r and 1:c inputs. EDIT: Using your two inputs of 1:r and 1:c, it...

11 years ago | 1

Answered
euler angles, method of direction cosines and quaternions for alpha = 30,45,60 deg
What is your question? If you want to check conversions between quaternions, direction cosine matrices, and Euler angles, I wou...

11 years ago | 0

Answered
how to allocate memory for these arrays.. in mex
It is not entirely clear what you need help with. Are you trying to dynamically create 2D or 3D arrays of variable size? I.e., a...

11 years ago | 0

| accepted

Answered
How to save values in vector for multiple loops?
Maybe this if you want a 3x2 result (but l is a really lousy name for a variable): n=2; m=3; k=[1; 2]; l = zeros(m...

11 years ago | 0

Answered
needed help for mex with 3D output matrix
(1) You are calling mxCreateNumericArray improperly, and this is likely the cause of the crash. The signature from the doc is ...

11 years ago | 1

| accepted

Answered
Matrix Manipulation Image Processing
doc sortrows

11 years ago | 0

Answered
how to concatenate multiple columns of an array to single column in matlab?
To convert to a cell array of strings, e.g., mat2cell(h,ones(size(h,1),1),2) This encapsulates the rows h(row,:) in indi...

11 years ago | 0

Answered
Sparse Block Matrix Construction
[Am,An] = size(A); [Bm,Bn] = size(B); X = spalloc(Am+Bm,An+Bn,nnz(A)+nnz(B)); X(Am+1:Am+Bm,1:Bn) = B; X(1:Am,Bn+1:...

11 years ago | 0

| accepted

Answered
How to generate white guassian noise, given standard deviation.
doc randn See section on Random Numbers from Normal Distribution with Specific Mean and Variance

11 years ago | 0

| accepted

Answered
How do you copy MATLAB strings to Fortran character variables?
Although it is not at all obvious from reading the doc, the mxCopyPtrToCharacter routine is intended to work *only* with C-style...

11 years ago | 2

| accepted

Answered
shrinking characters with condition
E.g., using a for loop to subdivide the entered text string into groups of 250 characters each (is that what you want?): n ...

11 years ago | 0

| accepted

Answered
Combining Matrices from a loop into a single large Matrix
Experienced MATLAB users cringe when we see code that has a boat load of variable names ending in numbers, like A92, A93, etc. T...

11 years ago | 2

Answered
How I can combine vectors in matrix
Assuming none of the x1 values are negative, which from the looks of your code seems to be an assumption you made. D = zero...

11 years ago | 0

| accepted

Answered
Efficient method for finding index of closest value in very large array for a very large amount of examples
This is a fairly simple mex routine if you start with both arrays sorted, since you don't need to make comparisons between all o...

11 years ago | 2

Answered
Problems re-transferring variables from Mex File to Matlab
I doubt you are getting back "empty" arrays. I think what you meant was you are getting back arrays with only 0's in them. Th...

11 years ago | 0

| accepted

Answered
Getting the values of a Matlab Structure using a FORTRAN MEX file
A few comments: (1) I would not use "index" for a variable name, since that is the name of a Fortran instrinsic function. Not...

11 years ago | 1

| accepted

Answered
Numerical error in addition within precision limit
"... All additions are within the precision limit ..." What do you mean by that statement? You are doing floating point arit...

11 years ago | 1

| accepted

Answered
Question about 2D Vector Multiplication
This is a simple outer product. Depending on what order you want the results, A.'*B or B.'*A

11 years ago | 1

Answered
Matlab jokes or puns
Why did MATLAB use the "Handbook of Mathematical Functions" by Abramowitz and Stegun in developing some of their function code? ...

11 years ago | 64

Answered
Parallel Matrix Multiplication
The best way to do matrix multiply in MATLAB is to use the * operator, as you normally would. This will call highly optimized BL...

11 years ago | 2

| accepted

Answered
how i can change this string array into one row and multiple columns.
Your syntax in the question specifies a cell array output of double values, so here is how to do that: n = numel(daalo{1});...

11 years ago | 1

| accepted

Answered
Inner dimensions must agree problem
What are you trying to do here? Nj(iz:end)*z Nj is a matrix with 3 columns and you are using linear indexing into it, wh...

11 years ago | 1

Answered
How can invert a complex matrix?!
The inv function works for complex matrices as well as real matrices. What do you mean by "didn't work correctly"? Did you get a...

11 years ago | 2

Answered
Great Circle Arc Distance Error with Dimensions
Getting a matrix result using ndgrid: function d = grcdistance(lon1,lat1,lon2,lat2) % D = GRCAZIM(LON1,LAT1,LON2,LAT2) ...

11 years ago | 1

Answered
Why slow conversion from date in Matlab time to day of year?
Try this variation using datevec instead of datestr: vecGmt = datevec(floor(timeGmt)); % Set hms to 0's using floor vecG...

11 years ago | 3

| accepted

Answered
HOW TO EXIST FROM A LOOP AND COME BACK TO IT AND THE ITERATION NUMBER CHANGE
I don't fully understand what you are trying to do, but I will say that in general if you want to change the loop index value in...

11 years ago | 0

Load more