Gelöst


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

etwa 10 Jahre vor

Gelöst


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

etwa 10 Jahre vor

Gelöst


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

etwa 10 Jahre vor

Gelöst


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

etwa 10 Jahre vor

Gelöst


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

etwa 10 Jahre vor

Gelöst


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

etwa 10 Jahre vor

Gelöst


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

etwa 10 Jahre vor

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

etwa 10 Jahre vor | 1

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

etwa 10 Jahre vor | 0

Frage


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

etwa 10 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


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

etwa 10 Jahre vor | 0 Antworten | 0

0

Antworten

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 1

| akzeptiert

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

etwa 10 Jahre vor | 2

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

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

etwa 10 Jahre vor | 0

| akzeptiert

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

etwa 10 Jahre vor | 0

| akzeptiert

Frage


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

etwa 10 Jahre vor | 1 Antwort | 4

1

Antwort

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Mehr laden