Gelöst


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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

Gelöst


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

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

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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

Gelöst


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

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

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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

Gelöst


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

etwa 5 Jahre vor

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 0

| akzeptiert

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 0

| akzeptiert

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 0

| akzeptiert

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 0

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

etwa 5 Jahre vor | 1

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

etwa 5 Jahre vor | 0

| akzeptiert

Mehr laden