Risposto
How can I find all possible combinations of rows from two separate arrays?
E.g., For arbitrary values in A and B, doesn't have to be B = -A n = size(A,1); C = repmat({A},2^n,1); mask = dec2bin((0:(2^n...

quasi 6 anni fa | 0

Risposto
Velocity,Acceleration,Angle
This is a dynamics class. Dynamics involves derivatives. How can you be in a dynamics class without knowing calculus and how t...

quasi 6 anni fa | 1

| accettato

Risposto
Randi(imax,m,n)
The point is that once the eps of the max value is greater than 1, you cannot represent contiguous sets of integer values in dou...

quasi 6 anni fa | 2

Risposto
How this code works and why for? What action does this code take?
You could look here: https://en.wikipedia.org/wiki/Bubble_sort

quasi 6 anni fa | 1

Risposto
Creating all possible combination of a letter/string
One way to create a matrix of these character strings: dem_a='ABC'; % assume starting string is all upper n = numel(dem_a); r...

quasi 6 anni fa | 1

| accettato

Risposto
Implementation of a matrix
You haven't told us what x and e are, but assuming x is a vector and e is a scalar, simply this: result = cos( (1:n) .* x(:) * ...

quasi 6 anni fa | 4

| accettato

Risposto
Array indices must be positive integers or logical values.
n = 0 and then you use it as an index: n=0; for i=n:1:tam-1 if xi(n)*xi(n+1)<0 You can't have a 0 index. Also, min is t...

quasi 6 anni fa | 0

Risposto
Formatting floating and integer signed numbers
sprintf("%0.2f%+0.2f",a,b) Having the + inside the %format stuff forces the sign to print.

quasi 6 anni fa | 0

| accettato

Risposto
For-loop in MATLAB
You should not modify the index variable i inside the loop: for i = 1:length(Corr_vector) : i=i+44; % this is ba...

quasi 6 anni fa | 0

Risposto
Finding All Combinations of Elements in a Vector
N = 6; result = dec2bin((0:(2^N-1))') - '0'; Then the various vectors you want are the rows of result. Or, if you really want...

quasi 6 anni fa | 1

| accettato

Risposto
About floating point format
The 64-bit floating point format is IEEE double: https://en.wikipedia.org/wiki/Double-precision_floating-point_format The 32-b...

quasi 6 anni fa | 0

Risposto
vector multiplied a matrix
Maybe this is what you want if c is 5 x 1 and T is 5 x 101: f = c.' * T;

quasi 6 anni fa | 1

| accettato

Risposto
why do i receive this error?
You have written a file called input.m that is shadowing the MATLAB function of the same name. You need to rename your input.m ...

quasi 6 anni fa | 0

Inviato


num2strexact (exact version of num2str)
num2strexact does exact conversion of number to string based on IEEE floating point bit pattern

quasi 6 anni fa | 1 download |

5.0 / 5
Thumbnail

Risposto
Binary to DNA sequence conversion
x = A(i:i+1); But if you are going to process pairs of characters in A, then maybe you need to step by 2 as well, e.g. for i=1...

quasi 6 anni fa | 0

| accettato

Risposto
Manipulating dimensions without using loops
It looks like the indexing is consecutive, it is just that you have a mixture of reshaping (which doesn't change memory order of...

quasi 6 anni fa | 0

Risposto
How can I rotate a set of points around an axis?
Arrange your points as column vectors and do a matrix multiply. E.g., result = rotmxXYZ * K.'; The result will have your point...

quasi 6 anni fa | 0

| accettato

Risposto
Solve linear least square problems with non-linear constraints
If you have two sets of corresponding points from two different coordinate systems and you are simply trying to find the "best" ...

quasi 6 anni fa | 0

Risposto
Error using mex : In function 'void mexFunction(int, mxArray**, int, const mxArray**)'
The error is not with mexFunction. The error is with line in your source code: const int32_t *dims1 = mxGetDimensions(prhs[1])...

quasi 6 anni fa | 1

Risposto
How to change code from C to matlab script?
This is just straightforward arithmetic, so the conversion is pretty simple. I would forget about using single precision floats...

quasi 6 anni fa | 1

| accettato

Risposto
Relative rotation between two IMU's
Assuming the coordinate frames are as follows: ECI, the world frame BODY1, the IMU1 body frame BODY2, the IMU2 body frame Ex...

quasi 6 anni fa | 0

| accettato

Risposto
How much money will I accumulate over x amount of years
Those last three lines need to be put into a loop. That is, each month this happens to the balance balance = balance * (1 + r)...

quasi 6 anni fa | 0

Risposto
Fibonacci.m for Fibonacci Series
You function is not vectorized ... that is, it is not written to handle anything other than a scalar input. As written, you wou...

quasi 6 anni fa | 0

| accettato

Risposto
slicing matrix in efficient way
Another way: a = 1:120; r = reshape(a,30,[]); x = r( 1:10,:); y = r(11:20,:); z = r(21:30,:);

quasi 6 anni fa | 1

Risposto
ode45 and euler not working for random signal
You can't use random inputs with ode45( ). ode45( ) relies on the ability to call the derivative function at arbitrary times to...

quasi 6 anni fa | 0

Risposto
Fourth Order Runge-Kutta Method for the System of three Differential Equation
I don't really want to sift through all of that code, mostly because you are using different variables for the various states. ...

quasi 6 anni fa | 1

Risposto
calling a c function with calllib doesn't work with pointers
A basic general outline of freeing the memory would be: double *sortie = NULL; // top level variable void free_sortie(void)...

quasi 6 anni fa | 0

Risposto
Problem using a mex.c file
Looks like you need to compile the mex file. You will need to install a C compiler if you haven't already. If there is a build...

quasi 6 anni fa | 0

Risposto
View Reshape Function Code
All it basically does is replace the dimensions with the requested dimensions in the internal variable header. There wouldn't b...

quasi 6 anni fa | 1

| accettato

Risposto
arrayfun syntax and use with scalar input
To use a scalar you could use this syntax: a=[1 2;3 4]; b=2; c=arrayfun(@(x)x+b,a); The function handle would pi...

quasi 6 anni fa | 0

| accettato

Carica altro