解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

解決済み


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

7年弱 前

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

7年弱 前 | 0

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 0

回答済み
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 ...

7年弱 前 | 0

回答済み
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...

7年弱 前 | 0

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 0

回答済み
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.

7年弱 前 | 0

回答済み
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)...

7年弱 前 | 0

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 0

回答済み
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...

7年弱 前 | 0

回答済み
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...

7年弱 前 | 1

回答済み
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...

7年弱 前 | 0

| 採用済み

さらに読み込む