Respondida
How to find the angle between two quaternions?
For example purposes I am using the coordinate frames as ECI and BODY Q1 = quaternion from ECI->BODY1 Q2 = quaternion from ECI...

casi 7 años hace | 2

| aceptada

Respondida
for loop, conditional operator
You are creating the variable filling_degree_regionI_new inside a condition if statement. If the condition is never met, the va...

casi 7 años hace | 0

| aceptada

Respondida
Get next or prior single precision value MATLAB function ?
The designers of IEEE floating point were brilliant. The next largest value (in magnitude) is always obtained by just adding 1 t...

casi 7 años hace | 0

| aceptada

Respondida
Arrays from c to matlab.
v is pointer-to-double, *v is double. Everywhere inside generation() that you use v it needs to be *v instead.

casi 7 años hace | 0

Respondida
Shuffling and Using a Set of Six 52-Card Decks
It is not entirely clear what you want. Maybe this instead of the loop? shuffledcard = decksofcards(randomcards);

casi 7 años hace | 0

Respondida
How to add new elements in a big array
Maybe assign into elements of N with indexing: N(j) = length(group);

casi 7 años hace | 1

| aceptada

Respondida
filling each row of a matrix using values from a vector
Assuming x starts as a 4x4 matrix (instead of a 3x4 matrix): x(sub2ind(size(x),(1:numel(u))',u)) = 1;

casi 7 años hace | 0

| aceptada

Respondida
Convert double array into column vector
Maybe one of these? reshape(f,1,[]) f(:).'

casi 7 años hace | 0

Respondida
uint16 to uint8
u16 = your uint16 variable u8 = typecast(u16,'uint8');

casi 7 años hace | 0

| aceptada

Respondida
API changes in R2019a?
I don't know if this is the cause of your problems, but there was a change to the low level mxArray variable structure in R2019a...

casi 7 años hace | 0

Respondida
complex number inside cell array
This might be done better with a loop, but here is a method using cellfun c = your cell array containing complex numbers resul...

casi 7 años hace | 0

| aceptada

Respondida
RK4 orbit problem
Couple of things: 1) You have picked the most convoluted method of coding your equations. Having four separate variables for yo...

casi 7 años hace | 1

Respondida
Portable declaration of REAL variables in mex gateway for Fortran
The REAL(kind(0.0D0)) vs REAL*8 discussion (and INTEGER*4 vs INTEGER etc) is a compiler issue, not a mex issue. As long as your...

casi 7 años hace | 0

Respondida
The return type of mxIsDouble, mxIsSingle, and mxIsClass (mex for Fortran)
Do what the documentation says and use INTEGER*4. Yes, it is non-standard but you are very unlikely to run into a compiler that...

casi 7 años hace | 0

Respondida
How can I generate random single precision (float32) numbers ?
For the generic answer with all bit patterns possible and selected with equal probability (including inf & nan & denorm) your "b...

casi 7 años hace | 1

Respondida
How can I show the 4-byte hex representation of a single precison float value?
s = your single float number h = dec2hex(typecast(s,'uint32'),8) And the reverse is s = typecast(uint32(hex2dec(h)),'single')...

casi 7 años hace | 0

| aceptada

Respondida
Error using mex: undefined reference for user build package
Try looking in the MATLAB/R2019a/extern/lib folder for versions of these files appropriate for your system. They might have slig...

alrededor de 7 años hace | 0

Respondida
Problem with MexFunction and MexGetPr
Impossible to answer without seeing the code for the functionsum( ) function. Maybe you could post that? Maybe all you need to...

alrededor de 7 años hace | 0

| aceptada

Respondida
Unexpected numerical error in built-in cross product
When I calculate things from scratch, everything works to the expected precision. E.g., run this code: % From post rTAN = [6.2...

alrededor de 7 años hace | 2

Respondida
MEX crashes when called twice in succession (Same input)
Here is one cause of a crash: mwIndex *subs; subs[0]=1; subs[1]=1; You are dereferencing an uninitialized pointer on that se...

alrededor de 7 años hace | 0

Respondida
Change sign of descending values
Is this what you want? x = your vector of values d = [1;diff(x)]; x(d<0) = -x(d<0);

alrededor de 7 años hace | 1

| aceptada

Respondida
Trouble with declaring function output
function data = importer

alrededor de 7 años hace | 1

| aceptada

Respondida
how to iterate a matrix for multiple times
E.g., here is a possible outline n = 30; % the number of iterations M = rand(5,5); % some initial matrix for k=1:n M = 2...

alrededor de 7 años hace | 1

| aceptada

Respondida
Using the dms2degree Command Sequentially to Populate an Array using a Sub-routine
With a for-loop, you need to use A in all of your indexing and use the [ ] brackets to form a vector input (and spell the functi...

alrededor de 7 años hace | 0

Respondida
Write a function called valid_date that takes three positive integer scalar inputs year, month, day. If these three represent a valid date, return a logical true, otherwise false. The name of the output argument is valid.
Looks like you are taking the same class as Rahul. Rather than repeat my answer here, I will simply direct you to the link: ht...

alrededor de 7 años hace | 3

| aceptada

Respondida
sum of multiplication for a vector and matrix
result = sum(b*A);

alrededor de 7 años hace | 1

Respondida
I need some help in seeing where I am going wrong and how to proceed with writing a particular funciton for a MATLAB course I am taking please.
Some issues: n is a fixed input ... you should not be changing n inside your function. Get rid of that n = n + 1 statement. T...

alrededor de 7 años hace | 1

| aceptada

Respondida
Use of int vs size_t in mex compilation of C-function dgemm.
If you are linking to the MATLAB supplied BLAS/LAPACK libraries, then all of the integer types being used for arguments to these...

alrededor de 7 años hace | 0

| aceptada

Respondida
For loop to extract every 3rd column out of matrix and assign as variable name
Do not do this! This will only lead to headaches downstream in your code for processing these variables (you will need to use m...

alrededor de 7 años hace | 1

| aceptada

Respondida
random generator on level of bytes
Generate random integers and then multiply them by 8 to guarantee that the result is divisible by 8. E.g., something like: max_...

alrededor de 7 años hace | 3

| aceptada

Cargar más