Answered
Help with using "nargin"
Think about what happens in your code if nargin == 1. In that case, b does not exist, but you get into the nargin<3 test and try...

11 years ago | 2

Answered
Significantly different time taken to index different columns of an array?
The profiler can be a bit arbitrary sometimes when assigning timing, and this might be one of those cases. I have seen cases whe...

11 years ago | 2

| accepted

Answered
if the cell duplicated put last column in the previous row
Maybe idx is empty (i.e., the find didn't result in a match). Do this to verify: dbstop if error Then run your code. Whe...

11 years ago | 2

| accepted

Answered
Matrix operations in three dimensions
You can build components without a loop by reshaping the vectors A, f, theta as 1x1xN and then using bsxfun with @times to get t...

11 years ago | 2

| accepted

Answered
mex usage efficiency question
You don't say definitely whether or not you will need the PCL cloud class data in a MATLAB variable for some reason (maybe some ...

11 years ago | 1

| accepted

Answered
How to save memory: loops or copy paste
The memory used by the code itself is insignificant, so looping vs copy-paste is not a memory concern. For maintainability and r...

11 years ago | 0

| accepted

Answered
ode15s XX must return a column vector
The "column vector" error can be resolved by changing the return variable into a column vector. E.g., dcdt(1) = 1.2e17*dp...

11 years ago | 1

| accepted

Answered
how to find the index value
If you are given the value 7 and want to find it in A and then get the corresponding row in B, then you could do this: x = ...

11 years ago | 0

| accepted

Answered
Error "Not enough input arguments" for a ode-function
I haven't looked at the code in detail, but the 1st argument of the ode15s call should be a function handle. E.g., [w_adiab...

11 years ago | 0

| accepted

Question


TMW Newsgroup Portal frozen?
The Newsgroup portal seems to be frozen. Nothing appearing beyond May 9, and I can't post anything through it. Are others seeing...

11 years ago | 0 answers | 0

0

answers

Answered
Setting up mex to use the Visual Studio 2013 compiler
MSVC 2013 was probably released too late for R2012b to include in their mex build files. You might look at this FEX submission: ...

11 years ago | 0

Answered
Will upgrading matlab from 2009b to 2015 improve performance of mex Funtions?
The speed of your mex routines will likely depend mostly on the compiler you are using, and not the MATLAB version you are using...

11 years ago | 1

Answered
I can't find the Compiler:Compaq visual fortran 6.5
R2010a does not officially support Compaq Visual Fortran: http://www.mathworks.com/support/compilers/R2010a/win32.html You...

11 years ago | 1

Answered
how to adjust mat's Decimal point
Not sure what the real question/problem is. If you want to display more digits on the screen, you can use the format command. E....

11 years ago | 0

Answered
Can I have array of sparse matrices?
Yes, but not directly with inbuilt MATLAB functionality. Instead, you can use this FEX submission by Matt J: http://www.mathw...

11 years ago | 0

Answered
passing a structure into a fortran subroutine in a mex file.
You will have to copy the data one field at a time. This is true for both passing in a structure and passing out a structure, pr...

11 years ago | 1

Answered
Sin(pi) or cos(pi/2) problem with Matlab
Pre-test the value of x. E.g., for scalar x: if( floor(x) == x ) f = inf; else f = x^7 + cos(x)^4 / sin(pi...

11 years ago | 0

Answered
Error in program (assignment A(I)=B)
To debug, at the command line type the following: dbstop if error Then run your code as usual. When the error occurs, yo...

11 years ago | 0

Answered
using BLAS function in a computational routine in mex
For -largeArrayDims I might expect the BLAS integer arguments to be 64-bit. You are passing 32-bit constant 1's in the 3rd argum...

11 years ago | 0

| accepted

Answered
How can I convert MATLAB code into C code?
See MATLAB Coder http://www.mathworks.com/help/coder/index.html

11 years ago | 1

Answered
why do i get the segmentation error while running a mex file? how do i solve this?
What are the types of the variables you are passing in? E.g., here is a check at the beginning or mexFunction for the 1st argume...

11 years ago | 1

| accepted

Answered
Is this a bug on the zero power of matrix?
There are multiple ways of evaluating the limit of x^y when x and y both go to 0. One of them, the way you used, is to start wit...

11 years ago | 0

Answered
Error using calllib, unable to load C/C++ libraries
In the calllib statement, try using 'toupcam' as the library name instead of 'toupcam.LIB'.

11 years ago | 1

| accepted

Answered
LOOP in matlab (for)
It appears you have multiple variables in your workspace with names such as U_01, U_02, ... U_60 and you want to make more of th...

11 years ago | 2

| accepted

Answered
mex C compiler cannot find .c file
What do you get whey you type: dir yprime.c Also, as a general rule you should *copy* source files from their original d...

11 years ago | 0

Answered
How to solve a matrix with increments
Your code turned into valid MATLAB syntax: %1.152T1 - 1.152T2 = -50974.255 sinx %1.536T1 + 1.536T2 = 50974.255 cosx ...

11 years ago | 0

| accepted

Answered
Retrieving (all) information from a cell array when meeting a predefined condition?
Using logical indexing: a(strcmp(a(:,1),refstring),:)

11 years ago | 0

| accepted

Answered
I've been getting several errors, especially "index must be a positive integer or logical."
In one line you have this: ...+(k2*(... and in the next line you have this: ...+(2*k2(... I assume the 2nd line ...

11 years ago | 0

| accepted

Answered
Number of maximum values and maximum values in each column
sum(bsxfun(@eq,A,max(A))) But for your example I get 2 1 3 1 1, not 2 1 3 2 1

11 years ago | 1

| accepted

Answered
Using mex to compile with \clr option
Adding a compiler flag to the mex process can be accomplished like this: filename = your source code file name compiler_...

11 years ago | 0

| accepted

Load more