239 total contributions since 2019

research interests: vibrations, optimal control, system modeling and simulation, mechatronics... coding

Solved

Remove the air bubbles

Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

1 día ago

Solved

Elapsed Time

Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

1 día ago

Answered

how to solve first order nonlinear ode45 in a loop?

Your code has some flaws: (1) theta(npeop,1) = Phi_i; is to be: theta(1:npeop,1) = Phi_i; (2) Moreover, there are several u...

how to solve first order nonlinear ode45 in a loop?

Your code has some flaws: (1) theta(npeop,1) = Phi_i; is to be: theta(1:npeop,1) = Phi_i; (2) Moreover, there are several u...

2 días ago | 0

Answered

StateFlow Negative in Condition Issue

One of the possible problems might be a built-in function assert(). Once I have had such problem and removed the wrong-placed as...

StateFlow Negative in Condition Issue

One of the possible problems might be a built-in function assert(). Once I have had such problem and removed the wrong-placed as...

2 días ago | 0

Answered

Preventing Emphasis in plot from Simulink Model

Maybe just save/store the data instead of plotting them while simulating the model and plot afterwards if there is no need to vi...

Preventing Emphasis in plot from Simulink Model

Maybe just save/store the data instead of plotting them while simulating the model and plot afterwards if there is no need to vi...

2 días ago | 0

Answered

How do I preallocate my variables for speed when creating an SIR model?

Memory allocation does not correct your code's errors. It helps to speed up the process of calculation and simulation. Your udp...

How do I preallocate my variables for speed when creating an SIR model?

Memory allocation does not correct your code's errors. It helps to speed up the process of calculation and simulation. Your udp...

2 días ago | 0

Answered

Changing default output in Publish (vsn 17b)

You can change [Edit Configurations] options... to publish in pdf as a default instead of html.

Changing default output in Publish (vsn 17b)

You can change [Edit Configurations] options... to publish in pdf as a default instead of html.

2 días ago | 0

Answered

How to get the values of for loop subsystem after every iteration in simulink

Have you tried these: https://www.mathworks.com/help/simulink/slref/selector.html https://www.mathworks.com/help/simulink/slre...

How to get the values of for loop subsystem after every iteration in simulink

Have you tried these: https://www.mathworks.com/help/simulink/slref/selector.html https://www.mathworks.com/help/simulink/slre...

2 días ago | 0

Solved

Pi Estimate 1

Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

2 días ago

Solved

Evil Number

Check if a given natural number is evil or not. Read more at <https://oeis.org/A001969 OEIS>.

3 días ago

Solved

Return the 3n+1 sequence for n

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

3 días ago

Solved

random picture with random colours

write a function which creates a random(x,y) matrix with random RGB colours for example create_pic(5,5) gives us a 3d matrix. ...

3 días ago

Solved

Solve the set of simultaneous linear equations

Given this pair of simultaneous linear equations: 2x + 3y = 23 3x + 4y = 32 Find the solution set (x,y)

3 días ago

Solved

radius of a spherical planet

You just measured its surface area, that is the input.

3 días ago

Solved

Pizza!

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

7 días ago

Solved

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

7 días ago

Solved

Operate on matrices of unequal, yet similar, size

You may want to add a vector to a matrix, implying that the vector is added to each column of the matrix. Or multiply a 3x4x5 ma...

7 días ago

Solved

Reverse the elements of an array

Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

7 días ago

Solved

Rotate input square matrix 90 degrees CCW without rot90

Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

7 días ago

Solved

Matrix with different incremental runs

Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

8 días ago

Solved

surrounded matrix

With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

8 días ago

Solved

Flip the main diagonal of a matrix

Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

8 días ago

Solved

Back to basics 23 - Triangular matrix

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

8 días ago

Solved

Back to basics 21 - Matrix replicating

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

8 días ago

Solved

Remove NaN ?

input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

8 días ago

Solved

Divide elements by sum of elements

In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

8 días ago

Solved

Find all elements less than 0 or greater than 10 and replace them with NaN

Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

8 días ago

Solved

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

8 días ago

Solved

Flip the vector from right to left

Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

8 días ago