Risolto


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

quasi 5 anni fa

Risolto


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

quasi 5 anni fa

Risolto


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

quasi 5 anni fa

Risolto


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

quasi 5 anni fa

Risolto


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

quasi 5 anni fa

Risolto


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

quasi 5 anni fa

Risolto


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

quasi 5 anni fa

Risolto


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

quasi 5 anni fa

Risolto


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

quasi 5 anni fa

Risolto


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

quasi 5 anni fa

Risolto


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

quasi 5 anni fa

Risolto


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

quasi 5 anni fa

Risolto


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

quasi 5 anni fa

Risolto


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

quasi 5 anni fa

Risolto


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

quasi 5 anni fa

Risolto


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

quasi 5 anni fa

Risposto
How can I build simulation target in r2017b?
Simulink builds a target model by default for more information you can check this.

circa 5 anni fa | 0

Risposto
Using textscan with lines of different length
You can get the line as an input using the function fgetl, it will take all the values in a line regardless of the datatypes and...

circa 5 anni fa | 0

| accettato

Risposto
Reading multiple NetCDF files in a Loop with multiple variables
If you want to overwrite graphs of other months over this one you can use hold on. If you want to divide the figure in differen...

circa 5 anni fa | 0

Risposto
Selecting a specific answer
You can use the function any to find out if any of the variables is equal to any other variable. any(a==[b c d]) will gave a ...

circa 5 anni fa | 0

Risposto
s function builder source generation location
Hey Joshua, You can cd to another directory and then use the s function builder so all the files are created there and then cop...

circa 5 anni fa | 0

Risposto
Extracting matrix and making 2D plot
You can change the limits by replacing latlim=[min(latmat(:)) max(latmat(:))] lonlim=[min(lonmat(:)) max(lonmat(:))] by lon...

circa 5 anni fa | 0

| accettato

Risposto
Index exceeds the number of array elements (1).
In the code above 'b' and 'c' are scalars and cannot be indexed. If you want to get an array of 'b' and 'c' as 'u' is increasing...

circa 5 anni fa | 0

Risposto
Is it possible to promote in one go the mask of a subsystem to the mask of the subsystem that encapsulates it?
You can copy the mask from one block to another using this. You can use the same for subsystems.

circa 5 anni fa | 0

Risposto
How do I change the amount of noise I want to add to a signal?
One method to do it is: >> noise = randi([-10,10]*10^n,[20,1])/10^n >> for i=1:size(noise) >> if noise(i)>9 >> b(i)...

circa 5 anni fa | 0

Risposto
codegeneration array out of bounds check
Hey Bernhard, Simulink does not support checking out of bound array possibility during code generation. You can run Simulnk De...

circa 5 anni fa | 0

| accettato

Risposto
Creating table of toggle buttons
Hey Luis, A single function can be used for callback of all the toggle buttons. The button which was pressed can be recognize...

circa 5 anni fa | 0

Risposto
Adding a marker to Data Marker to Heatmap (via imagesc)
Hey Jason, The second subplot command is creating another plot over the top of your original plot. Just remove the second subpl...

circa 5 anni fa | 0

Risposto
Using parametric equations in terms of theta1 and theta2 to plot a point A for a range of angles
Hey Raphael, Since Matlab does direct calculations of Vectors you dont need a for loop for this problem. theta1=20:0.5:80; th...

circa 5 anni fa | 1

Risposto
How do i implement moving average for prediction?
Hey Ali, It seems like in the Excel sheet the moving mean of ‘Actual’ is printed in ‘Forecast’. In Matlab ‘Forecast’ is used a...

circa 5 anni fa | 0

| accettato

Carica altro