Resuelto


Add two numbers
Given a and b, return the sum a+b in c.

alrededor de 10 años hace

Resuelto


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

alrededor de 10 años hace

Resuelto


Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

alrededor de 10 años hace

Resuelto


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

alrededor de 10 años hace

Resuelto


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

alrededor de 10 años hace

Resuelto


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...

alrededor de 10 años hace

Resuelto


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

alrededor de 10 años hace

Respondida
Using convolution to determine pdf of adding two triangular random variables
The |conv| function is essentially doing a numerical integration over |x|. It is not necessary that both pdfs be based on the sa...

alrededor de 10 años hace | 1

Respondida
filling the first NaN right after the last non NaN with a value that is half of the non NaN
You can use the function |isnan| to find the appropriate values to replace as in the following code: p = [ NaN 2...

alrededor de 10 años hace | 0

Pregunta


A Simulink.findVars equivalent for elements of a structure
The parameters used in my Simulink model are organized into a many-level structure. I would like to find out which of the elemen...

alrededor de 10 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to best randomize Simulink Random Number seeds for Rapid Accelerator simulation
I have a large model that I would like to execute iteratively in rapid simulation mode inside a parfor loop. The model contains ...

alrededor de 10 años hace | 0 respuestas | 0

0

respuestas

Respondida
I am trying to create a 5x5 array. How will I achieve this by using a nested loop?
The array you asked for can be created without a nested loop. Try: (1:5)'*(1:5) The enclosed statement, |(1:5)|, creates...

alrededor de 10 años hace | 0

Respondida
Can I use if ..break...else inside the same loop?
Your code looks fine. However, you can simplify the structure by adding |target = 0;| before your loop and omitting the else sta...

más de 10 años hace | 1

| aceptada

Respondida
appending an empty list
The behavior of |append| is specific to the data types input to it. For the basic types, you are probably better off using ...

más de 10 años hace | 2

Respondida
How to plot a function against a matrix?
I am assuming you mean to find the values of your function |g(x)| over all values defined in |r2|. If |a|, |b|, and |c| are scal...

más de 10 años hace | 0

Respondida
Hide all elements of an axis
In MATLAB R2015a, Legends are children of the figure, not the axes. For example, I expect you will be able to find the legend wi...

más de 10 años hace | 0

| aceptada

Respondida
How can I prevent the sim command from bringing the model to the top?
I am running MATLAB R2015a on Windows 7 and the |sim| command doesn't bring my model into focus. What version of MATLAB are you ...

más de 10 años hace | 0

Respondida
How to wait for an event without stopping the program?
You could accomplish this with a |timer| object. When a name is selected, use the callback to create and start a timer with |Exe...

más de 10 años hace | 0

| aceptada

Respondida
error - "Attempted to access w(0.000542549); index must be a positive integer or logical."
Just before your final |end| statement you have the line H0 = mod(1+cos(w(rho_d+rho_D)),0)/2 The error occurs when MATLA...

más de 10 años hace | 0

| aceptada

Pregunta


How can I tell Simulink Embedded Coder to get its variable names from my signal names, not the source block names?
I am generating C code from a Simulink model using Simulink Embedded Coder with the ERT target. I can see that the variable name...

más de 10 años hace | 1 respuesta | 4

1

respuesta

Resuelto


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

más de 10 años hace

Resuelto


Say something funny
Say something funny, or not. Your solution will be (fully automatically and objectively) scored based on how clever or funny ...

más de 10 años hace

Resuelto


Return the Nth Output from an Input Command
*Description* Given _F_, a cell array whose first element is a function handle and subsequent elements are arguments, return ...

más de 10 años hace

Resuelto


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

más de 10 años hace

Resuelto


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

más de 10 años hace

Resuelto


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

más de 10 años hace

Resuelto


Read a Soroban Abacus
*Description* The Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found <http://we...

más de 10 años hace

Resuelto


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

más de 10 años hace

Resuelto


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

más de 10 años hace

Resuelto


Function Iterator
Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

más de 10 años hace

Cargar más