Respondida
Is it possible to keep Matlab objects as mxArray type in C++ application ?
How do you plan on calling the MATLAB functions? With the Engine API interface? If so, then as long as you build the applicatio...

más de 10 años hace | 0

| aceptada

Respondida
mtimesx crashes when used
It has been a long time since I have had access to MATLAB with a C compiler, so it is hard for me to debug this. However, try th...

más de 10 años hace | 1

| aceptada

Respondida
Question about monte carlo simulation
Monte Carlo means you will be estimating the probability by making a large number of sample runs (aka trials) and then counting....

más de 10 años hace | 1

| aceptada

Respondida
How to add rows of data in a 5x5 Matrix
If you want to replace the inf values with 0 first, then A(isinf(A)) = 0;

más de 10 años hace | 0

| aceptada

Respondida
How to avoid going over Realmax in calculations
You might also try reordering the calculation of each term. E.g., take the exponential series: e^x = 1 + x + x^2/2! + x^3/3! ...

más de 10 años hace | 0

Respondida
How do I fix error: Index exceeds matrix dimensions?
Try this: for i=1:24:35040 Xday(icount,:)=mean(A.data(i:(i+23),:)); % <-- Changed 24*i to i+23 icount=icount+1; e...

más de 10 años hace | 0

Respondida
Is it possible to pass pointers to MATLAB structures through a COM interface?
Not sure how you have your particular COM interface set up. But, e.g. the MATLAB Engine API connection from a C/C++ program to M...

más de 10 años hace | 1

Respondida
What does this function do in matlab?
See the link on indexing: http://www.mathworks.com/help/matlab/math/matrix-indexing.html In particular, if you supply only...

más de 10 años hace | 0

| aceptada

Respondida
Delete rows from array
yi1 = your matrix yi1(10000:end,:) = [];

más de 10 años hace | 0

| aceptada

Respondida
Creation of a matrix (24,72) with unit lower triangular matrix?
Try this (caution, untested): M5 = zeros(24,72); M5(:,1:3:end) = tril(ones(24,24));

más de 10 años hace | 1

Respondida
How to input data from a .bin file into a 3D array?
You could read it into a vector and then reshape. E.g., image = fread(fid, 128*128*128, '*uint16'); image = reshape(imag...

más de 10 años hace | 1

| aceptada

Respondida
Apply function over all 3rd dimension
Depends on the specific function. For 'rank' you will in general need a loop so that the individual 2D matrices can be passed t...

más de 10 años hace | 0

| aceptada

Respondida
use matlab to calculate euler angles from rotation matrix, and then calculate rotation matrix. Why is the input matrix different from the output one?
You can use this FEX submission by John Fuller to double check your code: http://www.mathworks.com/matlabcentral/fileexchange...

más de 10 años hace | 0

Respondida
mxCreateNumericArray: increase array size at run-time
The only way is to reallocate the data memory and copy all of the data values over to the new memory area. If you increase the s...

más de 10 años hace | 0

| aceptada

Respondida
How do I change a vector from [5 3 2 5 5 4 1 2] to [1 3 4 1 1 2 5 4] switching the scale from 1-5 to 5-1?
x = [5 3 2 5 5 4 1 2]; y = 6 - x;

más de 10 años hace | 0

| aceptada

Respondida
Mex file access violation
Note that the signature for mxCopyPtrToReal8 is as follows: subroutine mxCopyPtrToReal8(px, y, n) mwPointer px real*8...

más de 10 años hace | 0

Respondida
physical and logical cores
MATLAB typically will use multiple cores automatically for functions that are programmed to use them. E.g., large matrix multip...

más de 10 años hace | 0

| aceptada

Respondida
MEX-based class constructors?
There is no API function for directly creating a "classdef" OOP object in mex like there is for numeric, struct, cell, etc varia...

más de 10 años hace | 1

| aceptada

Respondida
How can I combine two matrix ?
Another way: [y x] = ndgrid((1:7)+7,(1:7)); z = [x(:)';y(:)']; ee = [e1 e2]; e = ee(:,z(:));

más de 10 años hace | 0

Respondida
Debug Fortran Source MEX-Files error
You only need to include fintrf.h once per file, not once per routine. You have a typo for mxCreateStructMatrix. You have ...

más de 10 años hace | 2

| aceptada

Respondida
Mean of elements of array
mean_array = mean(reshape(array,10,[]));

más de 10 años hace | 1

| aceptada

Respondida
Fortran MEX returns inconsistent answers with -largeArrayDims
I haven't looked at the code in detail, but one thing I did notice was the declarations for the MXGETM and MXGETN functions are ...

más de 10 años hace | 0

| aceptada

Respondida
How to clear mxArray ?
You cannot re-use mxArrays as outputs from the mexCallMATLAB function. The mexCallMATLAB function *always* allocates a new mxAr...

más de 10 años hace | 0

Respondida
Invalid MEX-file, specific module could not be found
The error message 'Invalid MEX-file, specific module could not be found' often indicates that the mex routine was compiled under...

más de 10 años hace | 0

Respondida
Fastest way to multiply each block of an array with another matrix
If you have a C compiler: A = your 12 x 4 x N array; B = your 4 x 16 matrix; out = mtimesx(A,B); You can find mtim...

más de 10 años hace | 1

| aceptada

Respondida
how can I create a triangle that includes 1,12,123,1234,1235
You can start with this: n = 6; for k=1:n % Fill in code here for the pattern for this iteration end So you...

más de 10 años hace | 0

Respondida
how can someone make a 1234,123,12,1 pattern in a triangle
Here is a start for you. It might be easier to construct the loop using backwards indexing. E.g., n = 6; for k=n:-1:1 ...

más de 10 años hace | 0

| aceptada

Respondida
Hi all nice holiday ?
Is this what you want? It generates the random numbers, then in a loop uses the k'th sample r(k). a = 0.04; b = 0.07; ...

más de 10 años hace | 0

| aceptada

Respondida
How do I create a random variable which follows the Rademacher Distribution?
One way: n = number of samples; % <-- The number of samples you want mp = [-1 1]; % <-- The two values you want as o...

más de 10 años hace | 2

| aceptada

Respondida
How to resolve the "Index exceeds matrix dimensions" error ?
Type the following at the command line: dbstop if error Then run your program. When the error occurs, the program will ...

más de 10 años hace | 0

| aceptada

Cargar más