Solved


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

nästan 10 år 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...

nästan 10 år 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:...

nästan 10 år 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...

nästan 10 år ago

Solved


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

nästan 10 år ago

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

nästan 10 år ago

Solved


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

nästan 10 år ago

Answered
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]'); ...

ungefär 10 år ago | 0

Question


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

ungefär 10 år ago | 2 answers | 0

2

answers

Question


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

nästan 11 år ago | 1 answer | 0

1

answer

Question


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

ungefär 11 år ago | 1 answer | 0

1

answer

Question


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

mer än 11 år ago | 3 answers | 0

3

answers

Question


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

mer än 11 år ago | 2 answers | 0

2

answers