已解决


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

10 years 前

已回答
Using sscanf (or equivalent) to extract double from string.
Well, this seems to work. Elegance is overrated, right? aha name = '2.3A 4B C'; letterIndex = regexp(name,'[A-Z]'); ...

10 years 前 | 0

提问


Using sscanf (or equivalent) to extract double from string.
Let's say I have a string as follows: string = '2.3A 4B C' I want to apply a function that will output the following: ...

10 years 前 | 2 个回答 | 0

2

个回答

提问


Trouble with function using variable inputs.
Hello, I am fairly new to Matlab and am having a little difficulty using the "varargin" statement. I am trying to create a fu...

11 years 前 | 1 个回答 | 0

1

个回答

提问


How to make certain elements of a matrix equal to one?
For example, if I had: x = zeros(1,100) and I wanted to make the 3rd, 5th, 67th, and 93rd element equal to one, how could ...

11 years 前 | 1 个回答 | 0

1

个回答

提问


Is there an equivalent function to the "kron(x,y)" that uses subtraction as its operation rather than multiplication?
For example, say we have two matrices as follows: >> A = [1 2;3 4] A = 1 2 3 4 ...

11 years 前 | 3 个回答 | 0

3

个回答

提问


How to use a loop to calculate m*n values for an mxn matrix?
I have two matrices, both approximately 100x100, call them A and B. I am trying to multiply every element of matrix A by every ...

11 years 前 | 2 个回答 | 0

2

个回答