Solved


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

5 years ago

Solved


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

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

5 years ago

Solved


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

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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

Solved


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

5 years ago

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

5 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 0

| accepted

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

5 years ago | 0

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

5 years ago | 0

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

5 years ago | 1

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

5 years ago | 0

| accepted

Load more